Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
JingyaHuang committed Dec 20, 2024
1 parent 4a59f9d commit a0afb91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions optimum/exporters/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ def infer_task_from_model(
cache_dir=cache_dir,
token=token,
)
elif type(model) == type:
elif isinstance(model, type):
inferred_task_name = cls._infer_task_from_model_or_model_class(model_class=model)
else:
inferred_task_name = cls._infer_task_from_model_or_model_class(model=model)
Expand Down Expand Up @@ -1944,7 +1944,7 @@ def infer_library_from_model(
cache_dir=cache_dir,
token=token,
)
elif type(model) == type:
elif isinstance(model, type):
library_name = cls._infer_library_from_model_or_model_class(model_class=model)
else:
library_name = cls._infer_library_from_model_or_model_class(model=model)
Expand Down
6 changes: 3 additions & 3 deletions optimum/onnxruntime/runs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def __init__(self, run_config):
model_class = FeaturesManager.get_model_class_for_feature(get_autoclass_name(self.task))
self.torch_model = model_class.from_pretrained(run_config["model_name_or_path"])

self.return_body["model_type"] = (
self.torch_model.config.model_type
) # return_body is initialized in parent class
self.return_body[
"model_type"
] = self.torch_model.config.model_type # return_body is initialized in parent class

def _launch_time(self, trial):
batch_size = trial.suggest_categorical("batch_size", self.batch_sizes)
Expand Down

0 comments on commit a0afb91

Please sign in to comment.