Skip to content

Commit

Permalink
Fix optimizer's command line reading (#1961)
Browse files Browse the repository at this point in the history
  • Loading branch information
idruker-cerence authored Jul 16, 2024
1 parent ab4341b commit d9bd7c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions optimum/onnxruntime/subpackage/commands/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def run(self):
optimizer = ORTOptimizer.from_pretrained(self.args.onnx_model, file_names)

if self.args.config:
optimization_config = ORTConfig
optimization_config = ORTConfig.from_pretrained(self.args.config).optimization
elif self.args.O1:
optimization_config = AutoOptimizationConfig.O1()
elif self.args.O2:
Expand All @@ -97,6 +97,6 @@ def run(self):
elif self.args.O4:
optimization_config = AutoOptimizationConfig.O4()
else:
optimization_config = ORTConfig.from_pretained(self.args.config).optimization
raise ValueError("Either -O1, -O2, -O3, -O4 or -c must be specified.")

optimizer.optimize(save_dir=save_dir, optimization_config=optimization_config)

0 comments on commit d9bd7c3

Please sign in to comment.