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

Generate: Fix CI related to #20727 #21003

Merged
merged 2 commits into from
Jan 4, 2023
Merged

Generate: Fix CI related to #20727 #21003

merged 2 commits into from
Jan 4, 2023

Conversation

gante
Copy link
Member

@gante gante commented Jan 4, 2023

What does this PR do?

Fixes the error that showed up here: https://github.com/huggingface/transformers/actions/runs/3834635537/jobs/6527258530

Related to #20727

@gante gante requested a review from ydshieh January 4, 2023 18:04
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jan 4, 2023

The documentation is not available anymore as the PR was closed or merged.

@@ -3037,7 +3037,7 @@ def test_eos_token_id_int_and_list_greedy_search(self):
text = """Hello, my dog is cute and"""
tokens = tokenizer(text, return_tensors="pt")

model = GPT2LMHeadModel.from_pretrained("hf-internal-testing/tiny-random-gpt2").to(torch_device)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel it's better to keep it is, but change (line above)

tokens = tokenizer(text, return_tensors="pt")

to

tokens = tokenizer(text, return_tensors="pt").to(torch_device)

WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

TIL that can be done :D

Changed!

@gante gante requested a review from sgugger January 4, 2023 19:17
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.

Thanks for the fixes!

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

King of generate! Thanks

@gante gante merged commit b910489 into huggingface:main Jan 4, 2023
silverriver pushed a commit to silverriver/transformers that referenced this pull request Jan 6, 2023
venkat-natchi pushed a commit to venkat-natchi/transformers that referenced this pull request Jan 22, 2023
miyu386 pushed a commit to miyu386/transformers that referenced this pull request Feb 9, 2023
@gante gante deleted the 20727_fix branch May 18, 2023 15:26
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.

None yet

4 participants