Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Optimum - do not explictly pin transformers #1303

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading