Skip to content

Add support for mochi-1-preview (genmo) to huggingface.js #981

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

Merged
merged 6 commits into from
Oct 31, 2024

Conversation

ved-genmo
Copy link
Contributor

@ved-genmo ved-genmo commented Oct 23, 2024

Add mochi-1-preview to huggingface.js.

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the contribution (and the release) 🔥

@@ -680,6 +680,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
filter: false,
countDownloads: `path_extension:"safetensors" OR path_extension:"pt"`,
},
"mochi-1-preview": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question: isn't this too specific? Should it just be "mochi" or "mochi-1"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a good understanding of how libraries work (e.g, how is this linked to the actual huggingface page). I named it after the hugging face repository: https://huggingface.co/genmo/mochi-1-preview. But let me know if it should be called something else.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depend how you think the library will evolve. The name should match the library name from the model card metadata (here) which is currently library_name: mochi-1-preview. But it doesn't have to match the model repo id.

If the goal of the Python library on Github is to support this first preview version and then maybe some other versions or finetunes, then I would advice to chose mochi-1 for instance (as @pcuenca suggested). You can see the library as a family of models, not just one. If we go with mochi-1-preview, it means that either all other models will have to be tagged as mochi-1-preview or that we will have to add support for a new library tag.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @Wauplin's comments. You can see examples of libraries in this file, they include obvious ones such as transformers, but also smaller and more specific ones, for example https://huggingface.co/models?library=depth-anything-v2

Copy link
Contributor Author

@ved-genmo ved-genmo Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so this is enabling download counting for an entire library. Which means whatever file path I specify here should be found in all models. To be honest, I don't know if vae_stats.json will exist in all possible HuggingFace repositories. But, I guess we can update the elastic search query in the future.

For context, the Python library is going to support all Genmo models ever created. So, a huge variety of models.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I should rename the library to just "genmo"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Just genmo would be more cleaner and also make this PR forward compatible too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genmo's good in that case!
Since it will be compatible with a large variety of models, it could be nice to have at least a form of similar structure between models. Typically, you could add a config.json file with minimal information about the model, its architecture and what it is used for. If all genmo models has one, it might help the library + it will allow us to count the downloads in a consistent way. (I didn't chose the example randomly, config.json is actually the default file we are counting downloads from).

But this can be done in a later PR, once you have at least 2 genmo models.

Copy link
Contributor Author

@ved-genmo ved-genmo Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I updated the repository to have the library "genmo": https://huggingface.co/genmo/mochi-1-preview.

I also updated the library name to genmo.
If there are any small nits, do you want to just do the commits and merge? I'm super un-opinionated here, and just want to get download tracking for our repository enabled.

@@ -680,6 +680,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
filter: false,
countDownloads: `path_extension:"safetensors" OR path_extension:"pt"`,
},
"mochi-1-preview": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depend how you think the library will evolve. The name should match the library name from the model card metadata (here) which is currently library_name: mochi-1-preview. But it doesn't have to match the model repo id.

If the goal of the Python library on Github is to support this first preview version and then maybe some other versions or finetunes, then I would advice to chose mochi-1 for instance (as @pcuenca suggested). You can see the library as a family of models, not just one. If we go with mochi-1-preview, it means that either all other models will have to be tagged as mochi-1-preview or that we will have to add support for a new library tag.

Copy link
Member

@Vaibhavs10 Vaibhavs10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I can see that the original repo also has the same tag: https://huggingface.co/models?other=genmo

We can make the integration better re: download tracking if/ when you release other model checkpoints! Thanks for opening the PR 🤗

Let's wait for one more LGTM and then we can merge!

@Vaibhavs10 Vaibhavs10 changed the title Update model-libraries.ts Add support for mochi-1-preview (genmo) to huggingface.js Oct 31, 2024
@Vaibhavs10 Vaibhavs10 requested review from Wauplin and pcuenca October 31, 2024 12:11
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more LGTM! Thanks @ved-genmo 🤗

@Wauplin Wauplin merged commit 50e0374 into huggingface:main Oct 31, 2024
4 checks passed
@Wauplin
Copy link
Contributor

Wauplin commented Oct 31, 2024

I merged the PR. You can expect to see it deployed in the next few days.

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

Successfully merging this pull request may close these issues.

4 participants