Skip to content

Commit

Permalink
Fix the ORTQuantizer model path of the model to quantize (#701)
Browse files Browse the repository at this point in the history
Fix ort quantizer loading from specific file
  • Loading branch information
echarlaix authored Jan 18, 2023
1 parent a2b2ac8 commit edbfcf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/onnxruntime/quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def from_pretrained(

if isinstance(model_or_path, ORTModelForConditionalGeneration):
raise ValueError(ort_quantizer_error_message)
elif isinstance(model_or_path, Path):
elif isinstance(model_or_path, Path) and file_name is None:
onnx_files = list(model_or_path.glob("*.onnx"))
if len(onnx_files) == 0:
raise FileNotFoundError(f"Could not find any ONNX model file in {model_or_path}")
Expand Down

0 comments on commit edbfcf3

Please sign in to comment.