TranscriberWhisper¶
processing extra: transcriber-whisper
Transcribe audio packets using whisper models. For a full list of available models, see here: https://github.com/SYSTRAN/faster-whisper
- Node type:
TranscriberWhisper- Input:
AudioPayload- Output:
ObjectPayload- Extra:
transcriber-whisper
$ pip install "juturna-nodes[transcriber-whisper]"
How it works¶
The node keeps the last buffer_size audio messages of each upstream node,
and transcribes the whole buffer every time a new message arrives. It is meant
to follow a VAD node, such as VadSilero, but also works on plain audio:
a message with
meta['silence']set empties the buffer, and produces an empty transcript;word times are mapped back to the stream timeline through each buffered message’s
payload.startand itsmeta['speech_timestamps'](as set byVadSilero); a message withoutspeech_timestampscounts as one speech segment covering all its audio.
Each message triggers one transcription of the whole buffer: the audio of the
last buffer_size messages from that upstream node, concatenated. Every chunk
is therefore transcribed up to buffer_size times, and once the buffer is
full each call processes buffer_size chunks of audio (with the default, five
times the chunk length) to produce one message. buffer_size is the bound:
the buffer never holds more messages, and a message with meta['silence']
empties it, so the cost drops back after each pause. faster-whisper encodes
audio in 30 s windows (its default chunk_length): a buffer shorter than 30 s
costs one encoder window per call, and a longer one costs more. If the node
falls behind its input, lower buffer_size or send shorter chunks.
The output payload has a transcript key, with a list of words. start and
end are absolute times on the stream timeline, in seconds:
{
"transcript": [
{
"word": " hello",
"start": 12.0,
"end": 12.42,
"probability": 0.98
}
]
}
The name of the node the audio came from is stored in meta['origin'].
The model is loaded when the node is created. With only_local enabled (the
default), the model must already be in the local cache, and is never
downloaded.
Arguments¶
Argument |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Whisper model name, or path of a local model |
|
|
|
Only use local model files, and never download them |
|
|
|
Language of the source audio |
|
|
|
Task to perform ( |
|
|
|
Number of audio messages kept and transcribed together |
|
|
|
Where to run the model ( |
|
|
|
Compute word-level timestamps |
|
|
|
Skip timestamp generation |
License¶
Code: faster-whisper, MIT.
Weights: a model name such as
tinyis resolved by faster-whisper to a CTranslate2 conversion on Hugging Face (tiny→ Systran/faster-whisper-tiny, MIT on its model card). OpenAI releases the original Whisper code and weights under MIT (openai/whisper README).Runtime: CTranslate2, MIT.
The
transcriber-whisperextra installs faster-whisper, which importsav(PyAV, BSD-3-Clause), whose PyPI wheels bundle an FFmpeg that is effectively GPL (see the License section ofAudioRtp), and depends on onnxruntime (MIT).
Configuration¶
Default node arguments, as defined in the node config.toml file. Any of
them can be overridden in the node configuration of a pipeline.
[arguments]
model_name = "tiny"
only_local = true
language = "en"
word_timestamps = true
without_timestamps = false
task = "transcribe"
buffer_size = 5
device = "cuda"
[meta]
Pipeline usage¶
{
"name": "transcriber_whisper",
"type": "TranscriberWhisper",
"configuration": {}
}
Reference¶
- class TranscriberWhisper(
- model_name: str,
- only_local: bool,
- language: str,
- task: str,
- buffer_size: int,
- device: str,
- word_timestamps: bool = True,
- without_timestamps: bool = False,
- **kwargs,
Node implementation class