Skip to content

Commit

Permalink
fix format and update optimum-intel ipex version
Browse files Browse the repository at this point in the history
Signed-off-by: jiqing-feng <[email protected]>
  • Loading branch information
jiqing-feng committed Dec 17, 2024
1 parent f2e077e commit 574bc9b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ train = ["datasets", "accelerate>=0.20.3"]
onnx = ["optimum[onnxruntime]>=1.23.1"]
onnx-gpu = ["optimum[onnxruntime-gpu]>=1.23.1"]
openvino = ["optimum-intel[openvino]>=1.20.0"]
ipex = ["optimum-intel[ipex]>=1.20.0"]
ipex = ["optimum-intel[ipex]>=1.21.0"]
dev = ["datasets", "accelerate>=0.20.3", "pre-commit", "pytest", "pytest-cov", "peft"]

[build-system]
Expand Down
4 changes: 3 additions & 1 deletion sentence_transformers/models/Transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ def _load_model(
elif backend == "ipex":
self._load_ipex_model(model_name_or_path, config, cache_dir, **model_args)
else:
raise ValueError(f"Unsupported backend '{backend}'. `backend` should be `torch`, `onnx`, `openvino`, or `ipex`.")
raise ValueError(
f"Unsupported backend '{backend}'. `backend` should be `torch`, `onnx`, `openvino`, or `ipex`."
)

def _load_peft_model(self, model_name_or_path: str, config: PeftConfig, cache_dir: str, **model_args) -> None:
from peft import PeftModel
Expand Down
6 changes: 1 addition & 5 deletions tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@
## Testing exporting:
@pytest.mark.parametrize(
["backend", "expected_auto_model_class"],
[
("onnx", ORTModelForFeatureExtraction),
("openvino", OVModelForFeatureExtraction),
("ipex", IPEXModel)
],
[("onnx", ORTModelForFeatureExtraction), ("openvino", OVModelForFeatureExtraction), ("ipex", IPEXModel)],
)
@pytest.mark.parametrize(
"model_kwargs", [{}, {"file_name": "wrong_file_name"}]
Expand Down

0 comments on commit 574bc9b

Please sign in to comment.