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
e031162a
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "0558c9cb9b62771d3e3955dc15d34475c2c86995"
Unverified
Commit
e031162a
authored
Mar 30, 2021
by
Yih-Dar
Committed by
GitHub
Mar 30, 2021
Browse files
fix md file to avoid evaluation crash (#10962)
parent
3e09d813
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md
...les/research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md
+2
-2
No files found.
examples/research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md
View file @
e031162a
...
...
@@ -349,7 +349,7 @@ def speech_file_to_array_fn(batch):
return
batch
test_dataset
=
test_dataset
.
map
(
speech_file_to_array_fn
)
inputs
=
processor
(
test_dataset
[
"speech"
]
[:
2
]
,
sampling_rate
=
16_000
,
return_tensors
=
"pt"
,
padding
=
True
)
inputs
=
processor
(
test_dataset
[
:
2
][
"speech"
],
sampling_rate
=
16_000
,
return_tensors
=
"pt"
,
padding
=
True
)
with
torch
.
no_grad
():
logits
=
model
(
inputs
.
input_values
,
attention_mask
=
inputs
.
attention_mask
).
logits
...
...
@@ -357,7 +357,7 @@ with torch.no_grad():
predicted_ids
=
torch
.
argmax
(
logits
,
dim
=-
1
)
print
(
"Prediction:"
,
processor
.
batch_decode
(
predicted_ids
))
print
(
"Reference:"
,
test_dataset
[
"sentence"
]
[:
2
]
)
print
(
"Reference:"
,
test_dataset
[
:
2
][
"sentence"
])
```
...
...
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