From 6f80e80305d75664cd73acdce877f0a061f5cfaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danie=CC=88l=20de=20Kok?= Date: Tue, 30 Aug 2022 11:19:57 +0200 Subject: [PATCH] Don't train in any test_save_activations test --- spacy/tests/pipeline/test_entity_linker.py | 6 +----- spacy/tests/pipeline/test_spancat.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/spacy/tests/pipeline/test_entity_linker.py b/spacy/tests/pipeline/test_entity_linker.py index 50e187f61..75d1feea5 100644 --- a/spacy/tests/pipeline/test_entity_linker.py +++ b/spacy/tests/pipeline/test_entity_linker.py @@ -1212,11 +1212,7 @@ def test_save_activations(): assert "Q2146908" in entity_linker.kb.vocab.strings # initialize the NEL pipe - optimizer = nlp.initialize(get_examples=lambda: train_examples) - - for i in range(2): - losses = {} - nlp.update(train_examples, sgd=optimizer, losses=losses) + nlp.initialize(get_examples=lambda: train_examples) nO = entity_linker.model.get_dim("nO") diff --git a/spacy/tests/pipeline/test_spancat.py b/spacy/tests/pipeline/test_spancat.py index f6bc29ab8..42be9fbaf 100644 --- a/spacy/tests/pipeline/test_spancat.py +++ b/spacy/tests/pipeline/test_spancat.py @@ -426,7 +426,7 @@ def test_save_activations(): nlp = English() spancat = nlp.add_pipe("spancat", config={"spans_key": SPAN_KEY}) train_examples = make_examples(nlp) - optimizer = nlp.initialize(get_examples=lambda: train_examples) + nlp.initialize(get_examples=lambda: train_examples) nO = spancat.model.get_dim("nO") assert nO == 2 assert set(spancat.labels) == {"LOC", "PERSON"}