mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Avoid assuming encode.get_dim('nO') is set in tok2vec (#6800)
This commit is contained in:
parent
0a86d833d7
commit
ffc371350a
|
@ -101,6 +101,7 @@ def build_Tok2Vec_model(
|
||||||
embeddings, using an architecture such as a CNN, BiLSTM or transformer.
|
embeddings, using an architecture such as a CNN, BiLSTM or transformer.
|
||||||
"""
|
"""
|
||||||
tok2vec = chain(embed, encode)
|
tok2vec = chain(embed, encode)
|
||||||
|
if encode.has_dim("nO"):
|
||||||
tok2vec.set_dim("nO", encode.get_dim("nO"))
|
tok2vec.set_dim("nO", encode.get_dim("nO"))
|
||||||
tok2vec.set_ref("embed", embed)
|
tok2vec.set_ref("embed", embed)
|
||||||
tok2vec.set_ref("encode", encode)
|
tok2vec.set_ref("encode", encode)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user