Skip to content

minor change to avoid confusion in ch2-5#310

Merged
lewtun merged 2 commits into
huggingface:mainfrom
daspartho:ch2-5
Sep 13, 2022
Merged

minor change to avoid confusion in ch2-5#310
lewtun merged 2 commits into
huggingface:mainfrom
daspartho:ch2-5

Conversation

@daspartho

Copy link
Copy Markdown
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

HuggingFaceDocBuilderDev commented Sep 12, 2022

Copy link
Copy Markdown

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

@lewtun lewtun left a comment

Copy link
Copy Markdown
Member

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!

Comment thread chapters/en/chapter2/5.mdx Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

@lewtun I've made the suggested changes :)

@lewtun

lewtun commented Sep 13, 2022

Copy link
Copy Markdown
Member

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
GITbaburin pushed a commit to GITbaburin/course that referenced this pull request May 17, 2026
* minor change to avoid confusion

* added suggestion
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