-
Notifications
You must be signed in to change notification settings - Fork 487
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
Fix ort config instantiation (from_pretrained) and saving (save_pretrained) #1865
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
if isinstance(self.format, str): | ||
self.format = QuantFormat[self.format] | ||
if isinstance(self.mode, str): | ||
self.mode = QuantizationMode[self.mode] | ||
if isinstance(self.activations_dtype, str): | ||
self.activations_dtype = QuantType[self.activations_dtype] | ||
if isinstance(self.weights_dtype, str): | ||
self.weights_dtype = QuantType[self.weights_dtype] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post init : str -> enums
def to_dict(self) -> Dict[str, Any]: | ||
dict_config = { | ||
"opset": self.opset, | ||
"use_external_data_format": self.use_external_data_format, | ||
"one_external_file": self.one_external_file, | ||
"optimization": self.dataclass_to_dict(self.optimization), | ||
"quantization": self.dataclass_to_dict(self.quantization), | ||
} | ||
|
||
if self.optimum_version: | ||
dict_config["optimum_version"] = self.optimum_version | ||
|
||
return dict_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
called by the mixin at save time (BaseConfig)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks a lot @IlyasMoutawwakil
What does this PR do?
Fixes #1838
Before submitting
Who can review?