SpeakerEmbeddingFromAudio
Python template · sinapsis_huggingface_embeddings.templates.speaker_embedding_from_audio
Overview
The template provides functionality to generate embeddings for an audio provided in the DataContainer, using Huggingface models
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-huggingface-embeddings==1.0.0uv pip install sinapsis-huggingface-embeddings==1.0.0uv add sinapsis-huggingface-embeddings==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Optional
Default: null
Whether to apply normalization to the generated embeddings. If `True`, the embeddings will be normalized using the model's internal normalization mechanism, ensuring compatibility for tasks like voice verification. If `False`, the raw embeddings will be used without additional normalization. Defaults to `False`.
Optional
Default: false
HuggingFace source used to load the model. Defaults to "speechbrain/spkrec-xvect-voxceleb".
Optional
Default: "speechbrain/spkrec-xvect-voxceleb"
Type of packet in the `DataContainer` to which the embedding will be attached. Must be either `"texts"` or `"audios"`.
Required
Default: null
Directory in which the artifacts of the loaded model will be stored. Defaults to `SINAPSIS_CACHE_DIR`.
Optional
Default: "/home/ariel/.cache/sinapsis"
Configuration example
Example from the Python docstring:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: SpeakerEmbeddingFromAudio
class_name: SpeakerEmbeddingFromAudio
template_input: InputTemplate
attributes:
model_path: speechbrain/spkrec-xvect-voxceleb
data_cache_dir: /path/to/cache/dir
target_packet: 'audios'
normalize: falseShow schema-based configuration skeleton
templates:
- template_name: "SpeakerEmbeddingFromAudio"
class_name: "SpeakerEmbeddingFromAudio"
attributes:
normalize: false
model_path: "speechbrain/spkrec-xvect-voxceleb"
target_packet: "<required>"
data_cache_dir: "/home/ariel/.cache/sinapsis"
Inheritance
sinapsis_core.template_base.template.TemplateEnvironment variables
Environment definitions belong to their canonical Python modules.