TextToSpeechTransformers
Python template · sinapsis_huggingface_transformers.templates.text_to_speech_transformers
Overview
The template generates an audio from a prompt that is passed through the text packet in the DataContainer. It uses the transformers architecture and a HuggingFace model to produce the audio. Finally, it sends the audio through 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
The number of words per sentence when splitting the input text into smaller chunks. If not specified, sentences will be split based on punctuation.
Optional
Default: null
Optional
Default: null
Optional
Default: "suno/bark"
The sample rate (in Hz) for the generated audio. If not provided, the sample rate will be determined dynamically from the model.
Optional
Default: null
Optional
Default: "float16"
Whether to use speaker embeddings during audio generation. Defaults to `False`. If set to `True`, embeddings must be provided for each text packet.
Optional
Default: false
Optional
Default: "/home/ariel/.cache/sinapsis"
Optional
Default: null
Required
Default: null
Optional
Default: "float16"
Optional
Default: null
A dictionary of advanced parameters passed directly to the model's `generate` method for fine-tuning the pipeline generation.
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: TextToSpeechTransformers
class_name: TextToSpeechTransformers
template_input: InputTemplate
attributes:
model_path: '/path/to/model'
model_cache_dir: /path/to/cache/dir
device: 'cuda'
torch_dtype: float16
use_embeddings: false
sample_rate: 16000
n_words: 10Show schema-based configuration skeleton
templates:
- template_name: "TextToSpeechTransformers"
class_name: "TextToSpeechTransformers"
attributes:
seed: null
n_words: null
model_path: "suno/bark"
sample_rate: null
torch_dtype: "float16"
use_embeddings: false
model_cache_dir: "/home/ariel/.cache/sinapsis"
pipeline_kwargs:
device: "<required>"
torch_dtype: "float16"
inference_kwargs:
generate_kwargs: null
Inheritance
sinapsis_huggingface_transformers.templates.base_transformers.TransformersBaseEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.