mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Avoid adding empty layer in model, to keep models backwards compatible
This commit is contained in:
parent
c046392317
commit
99a6011580
|
@ -306,8 +306,9 @@ def Tok2Vec(width, embed_size, **kwargs):
|
|||
embed
|
||||
>> convolution ** conv_depth, pad=conv_depth
|
||||
)
|
||||
>> PyTorchBiLSTM(width, width, bilstm_depth)
|
||||
)
|
||||
if bilstm_depth >= 1:
|
||||
tok2vec = tok2vec >> PyTorchBiLSTM(width, width, bilstm_depth)
|
||||
# Work around thinc API limitations :(. TODO: Revise in Thinc 7
|
||||
tok2vec.nO = width
|
||||
tok2vec.embed = embed
|
||||
|
|
Loading…
Reference in New Issue
Block a user