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 Jukebox model (replaces #16875) #17826

Merged
merged 225 commits into from Nov 10, 2022
Merged

Conversation

ArthurZucker
Copy link
Collaborator

@ArthurZucker ArthurZucker commented Jun 22, 2022

This is a draft pull request.

What does this PR do?

This PR will progressively add the Jukebox model to the hub.
It is linked to #16870.

Currently planned steps (WIP)

  • Create template files with transformeres-cli add-new-model-like
  • src/transformers/tokenization_jukebox.py
  • src/transformers/test_tokenization_jukebox.py
  • src/transformers/configuration_jukebox.py
  • src/transformers/modeling_jukebox.py
  • src/transformers/configuration_jukebox.py
  • docs/source/model_doc/jukebox.rst
  • src/transformers/tokenization_jukebox_fast.py (will most probably use WordLevel tokenizer). Also requires to implement a converter function class JukeboxConverter(Converter):

@ArthurZucker ArthurZucker self-assigned this Jun 22, 2022
@ArthurZucker ArthurZucker added this to In progress in New model additions via automation Jun 22, 2022
@ArthurZucker ArthurZucker changed the title [WIP] Add Jukebox model #16875 [WIP] Add Jukebox model (replaces #16875) Jun 22, 2022
@ArthurZucker
Copy link
Collaborator Author

Replaces (#16875)

@ArthurZucker ArthurZucker mentioned this pull request Jun 22, 2022
8 tasks
@ArthurZucker ArthurZucker linked an issue Jun 22, 2022 that may be closed by this pull request
2 tasks
@ArthurZucker ArthurZucker added the WIP Label your PR/Issue with WIP for some long outstanding Issues/PRs that are work in progress label Jun 22, 2022
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@ArthurZucker
Copy link
Collaborator Author

As it was previously requested, you can now instantiate JukeboxVQVAE and JukeboxPrior individually. This is convenient if people only want to use the VQVAE or generate form juste the top level prior.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

A couple of last comments but we are almost there!

This model was contributed by [Arthur Zucker](https://huggingface.co/ArthurZ).
The original code can be found [here](https://github.com/openai/jukebox).

## JukeboxConfig
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would regroup all configs, then the tokenier, then the models (like for [CLIP]https://huggingface.co/docs/transformers/model_doc/clip)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay!

src/transformers/models/jukebox/configuration_jukebox.py Outdated Show resolved Hide resolved
src/transformers/models/jukebox/modeling_jukebox.py Outdated Show resolved Hide resolved
src/transformers/models/jukebox/modeling_jukebox.py Outdated Show resolved Hide resolved
Comment on lines +2275 to +2276
if isinstance(module, JukeboxPrior) or isinstance(module, JukeboxVQVAE):
module.apply(module._init_weights)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Clean!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@ArthurZucker ArthurZucker merged commit 61a51f5 into huggingface:main Nov 10, 2022
amyeroberts pushed a commit to amyeroberts/transformers that referenced this pull request Nov 14, 2022
mpierrau pushed a commit to mpierrau/transformers that referenced this pull request Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New model WIP Label your PR/Issue with WIP for some long outstanding Issues/PRs that are work in progress
Projects
Development

Successfully merging this pull request may close these issues.

OpenAI's Jukebox for music generation
4 participants