Skip to content

Commit

Permalink
Remove ort from transformers dependency (#1976)
Browse files Browse the repository at this point in the history
raise apt install message when ort is used
  • Loading branch information
rahul-tuli committed Jan 22, 2024
1 parent 805d2fc commit 923113e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"scikit-learn",
"seqeval",
"einops",
"onnxruntime>=1.0.0",
"accelerate>=0.20.3",
]
_yolov5_deps = _pytorch_vision_deps + [
Expand Down
8 changes: 7 additions & 1 deletion src/sparseml/export/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,13 @@ def validate_correctness(
:param validation_function: The function that will be used to validate the outputs.
:return: True if the validation passes, False otherwise.
"""
import onnxruntime as ort
try:
import onnxruntime as ort
except ImportError as err:
raise ImportError(
"The onnxruntime package is required for the correctness validation. "
"Please install it using 'pip install sparseml[onnxruntime]'."
) from err

sample_inputs_path = os.path.join(target_path, InputsNames.basename.value)
sample_outputs_path = os.path.join(target_path, OutputsNames.basename.value)
Expand Down

0 comments on commit 923113e

Please sign in to comment.