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
3d4b3bc3
Unverified
Commit
3d4b3bc3
authored
Jul 30, 2021
by
Stefan Schweter
Committed by
GitHub
Jul 30, 2021
Browse files
examples: use correct way to get vocab size in flax lm readme (#12947)
parent
23d6761f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/flax/language-modeling/README.md
examples/flax/language-modeling/README.md
+2
-2
No files found.
examples/flax/language-modeling/README.md
View file @
3d4b3bc3
...
@@ -114,7 +114,7 @@ from transformers import RobertaConfig
...
@@ -114,7 +114,7 @@ from transformers import RobertaConfig
model_dir
=
"./norwegian-roberta-base"
# ${MODEL_DIR}
model_dir
=
"./norwegian-roberta-base"
# ${MODEL_DIR}
config
=
RobertaConfig
.
from_pretrained
(
"roberta-base"
,
vocab_size
=
tokenizer
.
vocab_size
)
config
=
RobertaConfig
.
from_pretrained
(
"roberta-base"
,
vocab_size
=
tokenizer
.
get_
vocab_size
()
)
config
.
save_pretrained
(
model_dir
)
config
.
save_pretrained
(
model_dir
)
```
```
...
@@ -349,7 +349,7 @@ from transformers import T5Config
...
@@ -349,7 +349,7 @@ from transformers import T5Config
model_dir
=
"./norwegian-t5-base"
# ${MODEL_DIR}
model_dir
=
"./norwegian-t5-base"
# ${MODEL_DIR}
config
=
T5Config
.
from_pretrained
(
"google/t5-v1_1-base"
,
vocab_size
=
tokenizer
.
vocab_size
)
config
=
T5Config
.
from_pretrained
(
"google/t5-v1_1-base"
,
vocab_size
=
tokenizer
.
get_
vocab_size
()
)
config
.
save_pretrained
(
model_dir
)
config
.
save_pretrained
(
model_dir
)
```
```
...
...
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