-
Notifications
You must be signed in to change notification settings - Fork 837
Description
Is your feature request related to a problem? Please describe.
There is no option in huggingface_hub.hf_api to get the type of files in the repository or to get the base model of the checkpoint files.
Describe the solution you'd like
Please make it possible to retrieve using hf_api
Describe alternatives you've considered
baseModels should be in hf_api.model_info, but it is currently not available for use.
huggingface_hub/src/huggingface_hub/hf_api.py
Line 2500 in 2702ec2
| Possible values are `"author"`, `"baseModels"`, `"cardData"`, `"childrenModelCount"`, `"config"`, `"createdAt"`, `"disabled"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"gguf"`, `"inference"`, `"lastModified"`, `"library_name"`, `"likes"`, `"mask_token"`, `"model-index"`, `"pipeline_tag"`, `"private"`, `"safetensors"`, `"sha"`, `"siblings"`, `"spaces"`, `"tags"`, `"transformersInfo"`, `"trendingScore"`, `"widgetData"`, `"usedStorage"` and `"resourceGroup"`. |
Example
from huggingface_hub import hf_api
info = hf_api.model_info(
"stable-diffusion-v1-5/stable-diffusion-v1-5",
expand=["baseModels"]
)
print(info.baseModels)
# AttributeError: 'ModelInfo' object has no attribute 'baseModels'Additional context
I was creating a function to search for models using diffusers, but due to the lack of a method to retrieve data from hf_api, I couldn't implement it. Therefore, I would like to use it for the creation of the functions that couldn't be implemented
Also related to #2039