diff --git a/src/huggingface_hub/hf_api.py b/src/huggingface_hub/hf_api.py index 91f909d15e..76b35d841c 100644 --- a/src/huggingface_hub/hf_api.py +++ b/src/huggingface_hub/hf_api.py @@ -707,7 +707,14 @@ def __init__(self, **kwargs): ) self.spaces = kwargs.pop("spaces", None) safetensors = kwargs.pop("safetensors", None) - self.safetensors = SafeTensorsInfo(**safetensors) if safetensors else None + self.safetensors = ( + SafeTensorsInfo( + parameters=safetensors["parameters"], + total=safetensors["total"], + ) + if safetensors + else None + ) # backwards compatibility self.lastModified = self.last_modified