Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
c96aca3a
Unverified
Commit
c96aca3a
authored
May 14, 2024
by
Ankur Singh
Committed by
GitHub
May 14, 2024
Browse files
Added the necessay import of module (#30804)
parent
ccdabc56
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
docs/source/en/training.md
docs/source/en/training.md
+1
-0
No files found.
docs/source/en/training.md
View file @
c96aca3a
...
@@ -186,6 +186,7 @@ so we can just convert that directly to a NumPy array without tokenization!
...
@@ -186,6 +186,7 @@ so we can just convert that directly to a NumPy array without tokenization!
```
py
```
py
from
transformers
import
AutoTokenizer
from
transformers
import
AutoTokenizer
import
numpy
as
np
tokenizer
=
AutoTokenizer
.
from_pretrained
(
"google-bert/bert-base-cased"
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
"google-bert/bert-base-cased"
)
tokenized_data
=
tokenizer
(
dataset
[
"sentence"
],
return_tensors
=
"np"
,
padding
=
True
)
tokenized_data
=
tokenizer
(
dataset
[
"sentence"
],
return_tensors
=
"np"
,
padding
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment