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

minor change to avoid confusion in ch2-5 #310

Merged
merged 2 commits into from
Sep 13, 2022
Merged

minor change to avoid confusion in ch2-5 #310

merged 2 commits into from
Sep 13, 2022

Conversation

daspartho
Copy link
Contributor

very small PR

Change

Replaced "it" with "the tokenizer" on one line in ch2-5

Motivation

I was going through the course (which is fantastic by the way), and I was a little confused by this one line; perhaps it's just me, but I think it's better to replace "it" with the exact thing here to avoid confusion.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 12, 2022

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

Copy link
Member

@lewtun lewtun 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 this tweak @daspartho and welcome to the 🤗 community!

I've left a small suggestion and then we can merge this!

@@ -87,7 +87,7 @@ InvalidArgumentError: Input to reshape is a tensor with 14 values, but the reque

Oh no! Why did this fail? "We followed the steps from the pipeline in section 2.

The problem is that we sent a single sequence to the model, whereas 🤗 Transformers models expect multiple sentences by default. Here we tried to do everything the tokenizer did behind the scenes when we applied it to a `sequence`, but if you look closely, you'll see that it didn't just convert the list of input IDs into a tensor, it added a dimension on top of it:
The problem is that we sent a single sequence to the model, whereas 🤗 Transformers models expect multiple sentences by default. Here we tried to do everything the tokenizer did behind the scenes when we applied it to a `sequence`, but if you look closely, you'll see that the tokenizer didn't just convert the list of input IDs into a tensor, it added a dimension on top of it:
Copy link
Member

Choose a reason for hiding this comment

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

I think we can use this as an opportunity to split the long sentence :)

Suggested change
The problem is that we sent a single sequence to the model, whereas 🤗 Transformers models expect multiple sentences by default. Here we tried to do everything the tokenizer did behind the scenes when we applied it to a `sequence`, but if you look closely, you'll see that the tokenizer didn't just convert the list of input IDs into a tensor, it added a dimension on top of it:
The problem is that we sent a single sequence to the model, whereas 🤗 Transformers models expect multiple sentences by default. Here we tried to do everything the tokenizer did behind the scenes when we applied it to a `sequence`. But if you look closely, you'll see that the tokenizer didn't just convert the list of input IDs into a tensor, it added a dimension on top of it:

@daspartho
Copy link
Contributor Author

@lewtun I've made the suggested changes :)

@lewtun
Copy link
Member

lewtun commented Sep 13, 2022

Thanks for iterating!

@lewtun lewtun merged commit 7a4a051 into huggingface:main Sep 13, 2022
@daspartho daspartho deleted the ch2-5 branch September 13, 2022 15:51
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