Skip to content

Commit

Permalink
Fix onnx export for quantized MPT models (#1646)
Browse files Browse the repository at this point in the history
Empty dict raises an exception when exporting quantized MPT models because when `state_dict = {}`, the HF loading pipeline will try to initialize the model by calling `_init_weights` for each module. However, for MPT models, this function is not defined and will therefore raise an exception.
  • Loading branch information
eldarkurtic committed Jul 13, 2023
1 parent a8991c0 commit 488dfaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sparseml/transformers/utils/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def _loadable_state_dict(
f"after SparseML recipes have been applied {model_name_or_path}"
)

return {}, True
return None, True

@staticmethod
def _check_tf(model_name_or_path: str):
Expand Down

0 comments on commit 488dfaf

Please sign in to comment.