Skip to content

Commit

Permalink
Linting, remove unit markers
Browse files Browse the repository at this point in the history
  • Loading branch information
vblagoje committed May 14, 2024
1 parent 29cf933 commit bbb310b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion haystack/components/extractors/named_entity_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "NamedEntityExtractor":
Deserialized component.
"""
try:
init_params = data["init_parameters"]
init_params = data["init_parameters"]
if init_params["device"] is not None:
init_params["device"] = ComponentDevice.from_dict(init_params["device"])
init_params["backend"] = NamedEntityExtractorBackend[init_params["backend"]]
Expand Down
7 changes: 2 additions & 5 deletions test/components/extractors/test_named_entity_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from haystack.utils.device import ComponentDevice


@pytest.mark.unit
def test_named_entity_extractor_backend():
_ = NamedEntityExtractor(backend=NamedEntityExtractorBackend.HUGGING_FACE, model="dslim/bert-base-NER")

Expand All @@ -22,7 +21,6 @@ def test_named_entity_extractor_backend():
NamedEntityExtractor(backend="random_backend", model="dslim/bert-base-NER")


@pytest.mark.unit
def test_named_entity_extractor_serde():
extractor = NamedEntityExtractor(
backend=NamedEntityExtractorBackend.HUGGING_FACE,
Expand Down Expand Up @@ -54,9 +52,8 @@ def test_named_entity_extractor_pipeline_serde(tmp_path):
q = Pipeline.load(f)

assert p.to_dict() == q.to_dict(), "Pipeline serialization/deserialization with NamedEntityExtractor failed."


@pytest.mark.unit


def test_named_entity_extractor_serde_none_device():
extractor = NamedEntityExtractor(
backend=NamedEntityExtractorBackend.HUGGING_FACE, model="dslim/bert-base-NER", device=None
Expand Down

0 comments on commit bbb310b

Please sign in to comment.