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

Add support for custom checkpoints in MusicGen #30011

Merged
merged 4 commits into from
May 15, 2024

Conversation

jla524
Copy link
Contributor

@jla524 jla524 commented Apr 3, 2024

What does this PR do?

Fixes #29873 (issue)

Add a new argument for custom checkpoint and pass it intoget_pretrained

Who can review?

@ElizavetaSedova and @ArthurZucker

Comment on lines 212 to 214
"`['facebook/musicgen-stereo-small', 'facebook/musicgen-stereo-medium', 'facebook/musicgen-stereo-large']` "
"for the stereo checkpoints.",
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO we just have to update the doc here no?

Copy link
Collaborator

Choose a reason for hiding this comment

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

To mention that it can also be a path to a custom checkpoint

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 think decoder_config_from_checkpoint will throw an error with a custom checkpoint

raise ValueError(
"Checkpoint should be one of `['small', 'medium', 'large']` for the mono checkpoints, "
"or `['facebook/musicgen-stereo-small', 'facebook/musicgen-stereo-medium', 'facebook/musicgen-stereo-large']` "
f"for the stereo checkpoints, got {checkpoint}."
)

Is it possible to infer the config?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can update that error as well, the conversion script is not meant to only support official checkpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. The script should be flexible enough to support all checkpoints. Can we expect the custom checkpoints to follow the same naming scheme? i.e. musicgen-stereo-[small|medium|large]

@ArthurZucker
Copy link
Collaborator

Hey! Can you make sure the CI is green and ping me again for a reveiw!

@jla524
Copy link
Contributor Author

jla524 commented Apr 19, 2024

Hey @ArthurZucker! The CI is green now.

@huggingface huggingface deleted a comment from github-actions bot May 13, 2024
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Delay but thanks for the PR! 🔥

@ArthurZucker ArthurZucker merged commit 99e1612 into huggingface:main May 15, 2024
8 checks passed
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@jla524 jla524 deleted the custom_musicgen_checkpoint branch May 15, 2024 21:29
itazap pushed a commit that referenced this pull request May 24, 2024
* feat: support custom checkpoint

* update: revert changes and add TODO

* update: docs and exception handling

* fix: ah, extra space
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.

Uploading own MusicGen checkpoint
3 participants