SpeechToTextTransformers
Python template · sinapsis_huggingface_transformers.templates.speech_to_text_transformers
Overview
Template to perform speech-to-text actions using the HuggingFace module through the 'transformers' architecture.
The template takes an Audio from the DataContainer and uses a speech-recognition model to transcribe the audio. Finally, it returns the text in the DataContainer
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-huggingface-transformers==1.0.0uv pip install sinapsis-huggingface-transformers==1.0.0uv add sinapsis-huggingface-transformers==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Optional
Default: null
Optional
Default: null
Optional
Default: "openai/whisper-small"
Optional
Default: "float16"
Optional
Default: "/home/ariel/.cache/sinapsis"
Optional
Default: null
Required
Default: null
Optional
Default: "float16"
Task-specific parameters for the speech-to-text pipeline, such as `return_timestamps`.
Optional
Default: null
Optional
Default: null
If set, controls the granularity of timestamps returned with the transcribed text. Can be "char", "word", or True for segments.
Optional
Default: null
Configuration example
Example from the Python docstring:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: SpeechToTextTransformers
class_name: SpeechToTextTransformers
template_input: InputTemplate
attributes:
model_path: '/path/to/model'
model_cache_dir: /path/to/cache/dir
device: 'cuda'
torch_dtype: float16Show schema-based configuration skeleton
templates:
- template_name: "SpeechToTextTransformers"
class_name: "SpeechToTextTransformers"
attributes:
seed: null
model_path: "openai/whisper-small"
torch_dtype: "float16"
model_cache_dir: "/home/ariel/.cache/sinapsis"
pipeline_kwargs:
device: "<required>"
torch_dtype: "float16"
inference_kwargs:
generate_kwargs: null
return_timestamps: null
Inheritance
sinapsis_huggingface_transformers.templates.base_transformers.TransformersBaseEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.