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

[BugFix] Remove ort from transformers dependency #1976

Merged
merged 1 commit into from
Jan 18, 2024
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 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,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
Loading