Skip to content

Commit

Permalink
Enforce parameters as a List of Dictionaries in modelinfo.safetensors
Browse files Browse the repository at this point in the history
This PR modifies the model_info method to ensure that the SafeTensorsInfo instance is
initialized with a list of dictionaries for the parameters attribute, as intended by
the class definition.
  • Loading branch information
adiaholic committed Oct 2, 2024
1 parent ce38f46 commit 4a60eb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/huggingface_hub/hf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def __init__(self, **kwargs):
safetensors = kwargs.pop("safetensors", None)
self.safetensors = (
SafeTensorsInfo(
parameters=safetensors["parameters"],
parameters=[safetensors["parameters"]] if isinstance(safetensors["parameters"], dict) else safetensors["parameters"],
total=safetensors["total"],
)
if safetensors
Expand Down

0 comments on commit 4a60eb6

Please sign in to comment.