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
53dc39d8
Unverified
Commit
53dc39d8
authored
Oct 20, 2021
by
Patrick von Platen
Committed by
GitHub
Oct 20, 2021
Browse files
up (#14079)
parent
0bc2e54f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
examples/pytorch/speech-recognition/run_speech_recognition_ctc.py
.../pytorch/speech-recognition/run_speech_recognition_ctc.py
+6
-1
No files found.
examples/pytorch/speech-recognition/run_speech_recognition_ctc.py
View file @
53dc39d8
...
@@ -410,10 +410,15 @@ def main():
...
@@ -410,10 +410,15 @@ def main():
# load config
# load config
config
=
AutoConfig
.
from_pretrained
(
model_args
.
model_name_or_path
,
cache_dir
=
model_args
.
cache_dir
)
config
=
AutoConfig
.
from_pretrained
(
model_args
.
model_name_or_path
,
cache_dir
=
model_args
.
cache_dir
)
# tokenizer is defined by `tokenizer_class` if present in config else by `model_type`
config_for_tokenizer
=
config
if
config
.
tokenizer_class
is
not
None
else
None
tokenizer_type
=
config
.
model_type
if
config
.
tokenizer_class
is
None
else
None
# load feature_extractor, tokenizer and create processor
# load feature_extractor, tokenizer and create processor
tokenizer
=
AutoTokenizer
.
from_pretrained
(
tokenizer
=
AutoTokenizer
.
from_pretrained
(
training_args
.
output_dir
,
training_args
.
output_dir
,
tokenizer_type
=
config
.
model_type
,
config
=
config_for_tokenizer
,
tokenizer_type
=
tokenizer_type
,
unk_token
=
"[UNK]"
,
unk_token
=
"[UNK]"
,
pad_token
=
"[PAD]"
,
pad_token
=
"[PAD]"
,
word_delimiter_token
=
"|"
,
word_delimiter_token
=
"|"
,
...
...
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