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 input_embeds functionality to gpt_neo Causal LM #25659

Merged

Conversation

gaasher
Copy link
Contributor

@gaasher gaasher commented Aug 22, 2023

This PR follows up on #21405, #21889, and #22916 by @gante to GPTNeoCausalLM models, which allows these models to accept input_embeds when generating.

Who can review?

@gante @sgugger

Copy link
Member

@gante gante left a comment

Choose a reason for hiding this comment

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

Awesome, thank you for adding it @gaasher 🔥

src/transformers/models/gpt_neo/modeling_gpt_neo.py Outdated Show resolved Hide resolved
@gante
Copy link
Member

gante commented Aug 22, 2023

(CI can be fixed by running make fixup on transformers root, then committing the changes)

@HuggingFaceDocBuilderDev

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

@gaasher
Copy link
Contributor Author

gaasher commented Aug 22, 2023

(CI can be fixed by running make fixup on transformers root, then committing the changes)

Just did this!

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.

Thanks for the fix!
cc @ydshieh do you think it makes sense to add a common test for this? (small configs, nlp models, just test that we can use inputs_enmbeds for generation if past_key_values for most models, this way people add this automatically) ?

@ArthurZucker ArthurZucker merged commit 977b2f0 into huggingface:main Aug 22, 2023
3 checks passed
Comment on lines +707 to +709
model_inputs.update(
{
"input_ids": input_ids,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
model_inputs.update(
{
"input_ids": input_ids,
model_inputs.update(
{

gaasher added a commit to gaasher/transformers that referenced this pull request Aug 22, 2023
parambharat pushed a commit to parambharat/transformers that referenced this pull request Sep 26, 2023
* Updated gpt_neo causalLM to support using input embeddings for generation

* added indentation

* Did make fixup
blbadger pushed a commit to blbadger/transformers that referenced this pull request Nov 8, 2023
* Updated gpt_neo causalLM to support using input embeddings for generation

* added indentation

* Did make fixup
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