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
13297ac7
"docs/vscode:/vscode.git/clone" did not exist on "4037a2b5b1278736e566aec12e169100275545ea"
Unverified
Commit
13297ac7
authored
Feb 02, 2022
by
Sylvain Gugger
Committed by
GitHub
Feb 02, 2022
Browse files
Fic docstring of ASR pipeline (#15481)
parent
dd360d58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
src/transformers/pipelines/automatic_speech_recognition.py
src/transformers/pipelines/automatic_speech_recognition.py
+11
-14
No files found.
src/transformers/pipelines/automatic_speech_recognition.py
View file @
13297ac7
...
...
@@ -154,24 +154,21 @@ class AutomaticSpeechRecognitionPipeline(ChunkPipeline):
Args:
inputs (`np.ndarray` or `bytes` or `str` or `dict`):
The inputs is either :
- `str` that is the filename of the
audio file, the file will be read at the correct sampling rate to get the waveform using *ffmpeg*.
This
requires *ffmpeg* to be installed on the system.
- `bytes` it is supposed to be the
content of an audio file and is interpreted by *ffmpeg* in the same way.
- `str` that is the filename of the audio file, the file will be read at the correct sampling rate
to get the waveform using *ffmpeg*. This requires *ffmpeg* to be installed on the system.
- `bytes` it is supposed to be the content of an audio file and is interpreted by *ffmpeg* in the
same way.
- (`np.ndarray` of shape (n, ) of type `np.float32` or `np.float64`)
Raw audio at the correct sampling rate (no further check will be done)
- `dict` form can be used to pass raw audio sampled at arbirary `sampling_rate` and let
this
pipeline do the resampling. The dict must be in the fomat `{"sampling_rate": int, "raw":
np.array}` with optionally a `"stride": (left: int, right: int)` than can ask the pipeline to
treat the
first `left` samples and last `right` samples to be ignored in decoding (but used at
inference to
provide more context to the model). Only use `stride` with CTC models.
- `dict` form can be used to pass raw audio sampled at arbi
t
rary `sampling_rate` and let
this
pipeline do the resampling. The dict must be in the fo
r
mat `{"sampling_rate": int, "raw":
np.array}` with optionally a `"stride": (left: int, right: int)` than can ask the pipeline to
treat the
first `left` samples and last `right` samples to be ignored in decoding (but used at
inference to
provide more context to the model). Only use `stride` with CTC models.
Return:
A `dict` with the following keys:
- **text** (`str`) -- The recognized text.
`Dict`: A dictionary with the following keys:
- **text** (`str`) -- The recognized text.
"""
return
super
().
__call__
(
inputs
,
**
kwargs
)
...
...
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