Skip to content

Commit

Permalink
fix: Optimum - do not explictly pin transformers (#1303)
Browse files Browse the repository at this point in the history
* pin transformers!=4.48.0

* lint

* try removing explicit transformers dep
  • Loading branch information
anakin87 authored Jan 20, 2025
1 parent e973a19 commit ae27793
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion integrations/optimum/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ classifiers = [
]
dependencies = [
"haystack-ai",
"transformers[sentencepiece]",
# The main export function of Optimum into ONNX has hidden dependencies.
# It depends on either "sentence-transformers", "diffusers" or "timm", based
# on which model is loaded from HF Hub.
Expand Down
4 changes: 3 additions & 1 deletion integrations/optimum/tests/test_optimum_document_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def test_init_with_parameters(self, mock_check_valid_model): # noqa: ARG002
assert embedder._backend.parameters.optimizer_settings is None
assert embedder._backend.parameters.quantizer_settings is None

def test_to_and_from_dict(self, mock_check_valid_model, mock_get_pooling_mode): # noqa: ARG002
def test_to_and_from_dict(self, mock_check_valid_model, mock_get_pooling_mode, monkeypatch): # noqa: ARG002
monkeypatch.delenv("HF_API_TOKEN", raising=False)
monkeypatch.delenv("HF_TOKEN", raising=False)
component = OptimumDocumentEmbedder()
data = component.to_dict()

Expand Down
4 changes: 3 additions & 1 deletion integrations/optimum/tests/test_optimum_text_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def test_init_with_parameters(self, mock_check_valid_model): # noqa: ARG002
assert embedder._backend.parameters.optimizer_settings is None
assert embedder._backend.parameters.quantizer_settings is None

def test_to_and_from_dict(self, mock_check_valid_model, mock_get_pooling_mode): # noqa: ARG002
def test_to_and_from_dict(self, mock_check_valid_model, mock_get_pooling_mode, monkeypatch): # noqa: ARG002
monkeypatch.delenv("HF_API_TOKEN", raising=False)
monkeypatch.delenv("HF_TOKEN", raising=False)
component = OptimumTextEmbedder()
data = component.to_dict()

Expand Down

0 comments on commit ae27793

Please sign in to comment.