mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-24 08:14:15 +03:00
Auto-format code with black (#11687)
Co-authored-by: explosion-bot <explosion-bot@users.noreply.github.com>
This commit is contained in:
parent
fb280001cc
commit
84d9cb6b38
|
@ -274,8 +274,12 @@ def test_tok2vec_frozen_not_annotating():
|
||||||
|
|
||||||
for i in range(2):
|
for i in range(2):
|
||||||
losses = {}
|
losses = {}
|
||||||
with pytest.raises(ValueError, match=r"the tok2vec embedding layer is not updated"):
|
with pytest.raises(
|
||||||
nlp.update(train_examples, sgd=optimizer, losses=losses, exclude=["tok2vec"])
|
ValueError, match=r"the tok2vec embedding layer is not updated"
|
||||||
|
):
|
||||||
|
nlp.update(
|
||||||
|
train_examples, sgd=optimizer, losses=losses, exclude=["tok2vec"]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_tok2vec_frozen_overfitting():
|
def test_tok2vec_frozen_overfitting():
|
||||||
|
@ -289,7 +293,13 @@ def test_tok2vec_frozen_overfitting():
|
||||||
|
|
||||||
for i in range(100):
|
for i in range(100):
|
||||||
losses = {}
|
losses = {}
|
||||||
nlp.update(train_examples, sgd=optimizer, losses=losses, exclude=["tok2vec"], annotates=["tok2vec"])
|
nlp.update(
|
||||||
|
train_examples,
|
||||||
|
sgd=optimizer,
|
||||||
|
losses=losses,
|
||||||
|
exclude=["tok2vec"],
|
||||||
|
annotates=["tok2vec"],
|
||||||
|
)
|
||||||
assert losses["tagger"] < 0.0001
|
assert losses["tagger"] < 0.0001
|
||||||
|
|
||||||
# test the trained model
|
# test the trained model
|
||||||
|
|
Loading…
Reference in New Issue
Block a user