Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need more information about Model tree #1410

Open
Light1Smile opened this issue Sep 8, 2024 · 5 comments
Open

We need more information about Model tree #1410

Light1Smile opened this issue Sep 8, 2024 · 5 comments

Comments

@Light1Smile
Copy link

Doc request
I am very pleased that Hugging Face recently added the Model Tree, a really cool feature, and I believe it's a great tool for studying Model Reuse. However, I haven’t found much information in Hugging Face's documentation to better understand and use it. For example, information on all types of finetuning and the criteria for distinguishing them; how to retrieve all relevant finetuned models based on the model name via the API. I want to iterate on this to build a complete reuse network. As far as I know, adding a basemodel to the metadata will generate a Model Tree, and models with GGUF files are considered Quantizations, etc.

I hope there is relevant documentation available. If so, please provide the corresponding documentation links. If there is an API to call the Model Tree, please provide the related documentation. If not, I hope it can be developed and made available soon. Thank you very much.

Additional context
image

@osanseviero
Copy link
Member

osanseviero commented Sep 9, 2024

Edit

Using ?expand=baseModels is the best way as it supports redirects. See this as an example

https://huggingface.co/api/models/MaziyarPanahi/calme-2.1-qwen2-72b?expand=baseModels

Hi there 👋

We have some documentation on how to specify a base_model and how the relationship can be overridden https://huggingface.co/docs/hub/en/model-cards#specifying-a-base-model . You can programmatically get the base model by doing

model = model_info(model_id)
model.card_data.get("base_model")

Or alternatively get the whole tree using https://huggingface.co/api/models/MaziyarPanahi/calme-2.1-qwen2-72b?expand=baseModels

I agree we can document better (1) how the relationships are determined and (2) document the way to expand the whole tree

@osanseviero
Copy link
Member

cc @Wauplin @SBrandeis @Vaibhavs10

@NielsRogge
Copy link
Contributor

+1, in favor of having a tiny "learn more" button at each model tree which links to the docs.

@julien-c
Copy link
Member

julien-c commented Sep 9, 2024

model = model_info(model_id)
model.card_data.get("base_model")

not the best way because you don't get support for redirects of rename, etc

Better to get the baseModel in the model API directly

@Light1Smile
Copy link
Author

model = model_info(model_id)
model.card_data.get("base_model")

not the best way because you don't get support for redirects of rename, etc

Better to get the baseModel in the model API directly

I’m very glad to have received team's reply and got a lot of useful information 😊. However, if we are only retrieving the base model, at most, we can only obtain a chain from the current model to the original model. If it's possible to retrieve all the finetuned sub-models of a model via API, we could then follow the mentioned chain step by step to obtain the entire model reuse tree network, which contains hundreds of models. I think this is a really cool thing. May I ask, with the current API, is it possible to achieve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants