mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-03 03:09:28 +00:00
docs: fix whisper_local indentations docstrings (#6209)
* whisper_local indentations * Update whisper_local.py * fix param docstrings --------- Co-authored-by: Massimiliano Pippi <mpippi@gmail.com>
This commit is contained in:
parent
72cbf3ee0b
commit
08e211f9d6
@ -36,12 +36,9 @@ class LocalWhisperTranscriber:
|
|||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
:param model_name_or_path: Name of the model to use. Set it to one of the following values:
|
:param model_name_or_path: Name of the model to use. Set it to one of the following values:
|
||||||
- `tiny`
|
:type model_name_or_path: Literal["tiny", "small", "medium", "large", "large-v2"]
|
||||||
- `small`
|
|
||||||
- `medium`
|
|
||||||
- `large`
|
|
||||||
- `large-v2`
|
|
||||||
:param device: Name of the torch device to use for inference. If None, CPU is used.
|
:param device: Name of the torch device to use for inference. If None, CPU is used.
|
||||||
|
:type device: Optional[str]
|
||||||
"""
|
"""
|
||||||
whisper_import.check()
|
whisper_import.check()
|
||||||
if model_name_or_path not in get_args(WhisperLocalModel):
|
if model_name_or_path not in get_args(WhisperLocalModel):
|
||||||
@ -78,8 +75,8 @@ class LocalWhisperTranscriber:
|
|||||||
[Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper
|
[Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper
|
||||||
[github repo](https://github.com/openai/whisper).
|
[github repo](https://github.com/openai/whisper).
|
||||||
|
|
||||||
:param audio_files: a list of paths or binary streams to transcribe
|
:param audio_files: A list of paths or binary streams to transcribe.
|
||||||
:returns: a list of Documents, one for each file. The content of the document is the transcription text,
|
:returns: A list of Documents, one for each file. The content of the document is the transcription text,
|
||||||
while the document's metadata contains all the other values returned by the Whisper model, such as the
|
while the document's metadata contains all the other values returned by the Whisper model, such as the
|
||||||
alignment data. Another key called `audio_file` contains the path to the audio file used for the
|
alignment data. Another key called `audio_file` contains the path to the audio file used for the
|
||||||
transcription.
|
transcription.
|
||||||
@ -101,8 +98,8 @@ class LocalWhisperTranscriber:
|
|||||||
[Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper
|
[Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper
|
||||||
[github repo](https://github.com/openai/whisper).
|
[github repo](https://github.com/openai/whisper).
|
||||||
|
|
||||||
:param audio_files: a list of paths or binary streams to transcribe
|
:param audio_files: A list of paths or binary streams to transcribe.
|
||||||
:returns: a list of Documents, one for each file. The content of the document is the transcription text,
|
:returns: A list of Documents, one for each file. The content of the document is the transcription text,
|
||||||
while the document's metadata contains all the other values returned by the Whisper model, such as the
|
while the document's metadata contains all the other values returned by the Whisper model, such as the
|
||||||
alignment data. Another key called `audio_file` contains the path to the audio file used for the
|
alignment data. Another key called `audio_file` contains the path to the audio file used for the
|
||||||
transcription.
|
transcription.
|
||||||
@ -125,8 +122,8 @@ class LocalWhisperTranscriber:
|
|||||||
[Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper
|
[Whisper API documentation](https://platform.openai.com/docs/guides/speech-to-text) and the official Whisper
|
||||||
[github repo](https://github.com/openai/whisper).
|
[github repo](https://github.com/openai/whisper).
|
||||||
|
|
||||||
:param audio_files: a list of paths or binary streams to transcribe
|
:param audio_files: A list of paths or binary streams to transcribe.
|
||||||
:returns: a list of transcriptions.
|
:returns: A list of transcriptions.
|
||||||
"""
|
"""
|
||||||
return_segments = kwargs.pop("return_segments", False)
|
return_segments = kwargs.pop("return_segments", False)
|
||||||
transcriptions = []
|
transcriptions = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user