Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Feb 14, 2024
1 parent 9859995 commit 4ed0861
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ def get_embedding_backend(model: str, device: Optional[str] = None, token: Optio
if embedding_backend_id in _InstructorEmbeddingBackendFactory._instances:
return _InstructorEmbeddingBackendFactory._instances[embedding_backend_id]

embedding_backend = _InstructorEmbeddingBackend(
model=model, device=device, token=token
)
embedding_backend = _InstructorEmbeddingBackend(model=model, device=device, token=token)
_InstructorEmbeddingBackendFactory._instances[embedding_backend_id] = embedding_backend
return embedding_backend

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ def test_model_initialization(mock_instructor):
"haystack_integrations.components.embedders.instructor_embedders.embedding_backend.instructor_backend.INSTRUCTOR"
)
def test_embedding_function_with_kwargs(mock_instructor): # noqa: ARG001
embedding_backend = _InstructorEmbeddingBackendFactory.get_embedding_backend(
model="hkunlp/instructor-base"
)
embedding_backend = _InstructorEmbeddingBackendFactory.get_embedding_backend(model="hkunlp/instructor-base")

data = [["instruction", "sentence1"], ["instruction", "sentence2"]]
embedding_backend.embed(data=data, normalize_embeddings=True)
Expand Down

0 comments on commit 4ed0861

Please sign in to comment.