-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
I noticed the # downloads and # likes in the model dropdown is hard coded. I dug around into the Huggingface Hub API and found that we can access this info via GET requests. Here's an example of doing it for gte-mini:
const url = "https://huggingface.co/api/models/TaylorAI/gte-tiny";
const headers = {
"user-agent": "unknown/None;",
"Accept-Encoding": "gzip, deflate",
"Accept": "*/*",
"Connection": "keep-alive",
};
fetch(url, { method: 'GET', headers: headers })
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
You can enter the following code in the JS console to verify it works. The downloads and likes entries directly get us those values, but the model size is a bit harder, especially because we are hardcoding the size of the Onyx model. I'm not sure if we can even get that value.
Additionally, I want to ask @do-me what it means when a model has many different download sizes in the dropdown, e.g. snowflake-arctic-embed-xs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels