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

Fix failing test_batch_generation for bloom #25718

Merged
merged 1 commit into from
Aug 24, 2023
Merged

Fix failing test_batch_generation for bloom #25718

merged 1 commit into from
Aug 24, 2023

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Aug 24, 2023

What does this PR do?

#25571 changed this test. There was a tiny issue. See my comment along the change in this PR.

We should probably to change this variable names in multiple places for house keeping.

Also cc @gante 😄

@@ -449,9 +449,9 @@ def test_batch_generation(self):

input_sentence = ["I enjoy walking with my cute dog", "I enjoy walking with my cute dog"]

input_ids = tokenizer.batch_encode_plus(input_sentence, return_tensors="pt", padding=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not actually ids

@@ -449,9 +449,9 @@ def test_batch_generation(self):

input_sentence = ["I enjoy walking with my cute dog", "I enjoy walking with my cute dog"]

input_ids = tokenizer.batch_encode_plus(input_sentence, return_tensors="pt", padding=True)
input_ids = input_ids["input_ids"].to(torch_device)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no ids

@@ -449,9 +449,9 @@ def test_batch_generation(self):

input_sentence = ["I enjoy walking with my cute dog", "I enjoy walking with my cute dog"]

input_ids = tokenizer.batch_encode_plus(input_sentence, return_tensors="pt", padding=True)
input_ids = input_ids["input_ids"].to(torch_device)
attention_mask = input_ids["attention_mask"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no attention_mask in the actual ids

input_ids = tokenizer.batch_encode_plus(input_sentence, return_tensors="pt", padding=True)
input_ids = input_ids["input_ids"].to(torch_device)
attention_mask = input_ids["attention_mask"]
inputs = tokenizer.batch_encode_plus(input_sentence, return_tensors="pt", padding=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good name and avoid failure.

@ydshieh ydshieh requested a review from ArthurZucker August 24, 2023 08:57
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.

😅 Nice catch !

@ydshieh
Copy link
Collaborator Author

ydshieh commented Aug 24, 2023

😅 Nice catch !

I was caught by the failed CI 😢

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 24, 2023

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

@ydshieh ydshieh merged commit 8fff61b into main Aug 24, 2023
@ydshieh ydshieh deleted the fix_bloom_test branch August 24, 2023 09:15
parambharat pushed a commit to parambharat/transformers that referenced this pull request Sep 26, 2023
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
blbadger pushed a commit to blbadger/transformers that referenced this pull request Nov 8, 2023
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 18, 2023
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
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.

3 participants