mirror of https://github.com/explosion/spaCy.git
Avoid assuming encode.get_dim('nO') is set in tok2vec (#6800)
This commit is contained in:
parent
0a86d833d7
commit
ffc371350a
|
@ -101,7 +101,8 @@ 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)
|
||||||
tok2vec.set_dim("nO", encode.get_dim("nO"))
|
if encode.has_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)
|
||||||
return tok2vec
|
return tok2vec
|
||||||
|
|
Loading…
Reference in New Issue