Skip to content

Commit

Permalink
minor change to avoid confusion in ch2-5 (#310)
Browse files Browse the repository at this point in the history
* minor change to avoid confusion

* added suggestion
  • Loading branch information
daspartho authored Sep 13, 2022
1 parent 796f41d commit 7a4a051
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapters/en/chapter2/5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

{#if fw === 'pt'}
```py
Expand Down

0 comments on commit 7a4a051

Please sign in to comment.