Skip to content

Commit aa60527

Browse files
committed
minor
Signed-off-by: Zhiyu Cheng <zhiyuc@nvidia.com>
1 parent 6fe5740 commit aa60527

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modelopt/torch/export/unified_export_hf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,11 @@ def _export_diffusers_checkpoint(
993993
print(f"Export complete. Saved to: {export_dir}")
994994

995995

996+
# TODO: Remove this workaround once HuggingFace fixes revert_weight_conversion to handle
997+
# scalar (0-d) tensors. The bug is in transformers' Chunk.convert() which calls
998+
# tensor.size(self.dim) on quantization scale buffers that are 0-d scalars, causing
999+
# IndexError. Confirmed still present in transformers 5.2.0.
1000+
# See: transformers/core_model_loading.py, Chunk.convert()
9961001
def _revert_weight_conversion_noop(model: Any, state_dict: dict) -> dict:
9971002
"""No-op replacement for transformers' revert_weight_conversion."""
9981003
return state_dict

0 commit comments

Comments
 (0)