How to get all model revisions
Many models now have their checkpoints shared (e.g.allenai/OLMo-1B at main)But it is often hard to recreate by code the naming conventions of the revisions (e.g., in the example above, the tokens seen is not a series one can compute).Is there a way to ask the hub (or github API?) for a list of all the revisions a model has?nonworking code exampleimport hub
revision_list = hub.get_revision("olmo-7B")
for rev in revision_list:
print(rev) # StepxTokensY
2024-03-01T14:08:37Z
hi@borgr,You get all the repo references using our API!pip -q install huggingface_hub
from huggingface_hub import HfApi
api = HfApi()
api.list_repo_refs("allenai/OLMo-7B")
2024-03-01T15:25:59Z
For future readers:!pip -q install huggingface_hub
from huggingface_hub import HfApi
api = HfApi()
refs = api.list_repo_refs("allenai/OLMo-7B")
for branch in refs.branches:
   name = branch.name
2024-03-02T03:26:29Z
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.