You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docstring (and auto-generated web docs) for get_safetensors_metadata() claim there is a filename parameter, but there is none in the actual function signature. Example code:
>>> from huggingface_hub import get_safetensors_metadata
>>> x = get_safetensors_metadata("dslim/bert-base-NER") # This works fine
>>> x = get_safetensors_metadata("dslim/bert-base-NER", filename="model.safetensors") # This fails
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: HfApi.get_safetensors_metadata() got an unexpected keyword argument 'filename'
>>> import huggingface_hub
>>> huggingface_hub.__version__ # I'm using a slightly old version of HF Hub but the git blame says the function signature is entirely unchanged for the last 9 months
'0.24.6'
Ideally, an error like this should be caught by a pre-commit hook.
The text was updated successfully, but these errors were encountered:
Hi @boyleconnor, thanks for catching this! it's indeed an oversight in the docstring, to parse parse metadata from a single safetensors file, we recommend using parse_safetensors_file_metadata() instead as get_safetensors_metadata() is meant to parse a safetensors repo.
a PR #2738 is open to fix this!
The docstring (and auto-generated web docs) for
get_safetensors_metadata()
claim there is afilename
parameter, but there is none in the actual function signature. Example code:Ideally, an error like this should be caught by a pre-commit hook.
The text was updated successfully, but these errors were encountered: