SinapsisSortformerDiarizer
Python template · sinapsis_diarization.templates.sortformer_diarizer_template
Overview
Sortformer Diarizer Template. Runs a diarization pipeline with sortformer models. Sortformer[1] is a novel end-to-end neural model for speaker diarization, trained with unconventional objectives compared to existing end-to-end diarization models. Streaming Sortformer[2] employs an Arrival-Order Speaker Cache (AOSC) to store frame-level acoustic embeddings of previously observed speakers. Sortformer resolves permutation problem in diarization following the arrival-time order of the speech segments from each speaker.
Supported models: 'nvidia/diar_streaming_sortformer_4spk-v2.1'
Attributes: model_name (str): name of model to run device (str): device to run the model sample_rate (int): sample rate of the audio chunk_size_in_secs (int): Size of the chunks to divide the audio. -1 for full audio search_window (float): Size of the search window root_dir(str): Path to root directory. Optional audio_file_path (str): Path to audio file. Optional
Example agent:
agent: name: my_test_agent templates: - template_name: InputTemplate class_name: InputTemplate attributes: {} - template_name: SinapsisSortformerDiarizer class_name: SinapsisSortformerDiarizer template_input: InputTemplate attributes: model_name: nvidia/diar_streaming_sortformer_4spk-v2.1 device: cuda sample_rate: 16000 chunk_size_in_secs: -1 search_window: 5.0 root_dir: /root/.cache/sinapsis audio_file_path: null
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-diarization==1.0.0uv pip install sinapsis-diarization==1.0.0uv add sinapsis-diarization==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
device to run the model
Optional
Default: "cuda"
Optional
Default: null
Path to root directory. Optional
Optional
Default: "/home/ariel/.cache/sinapsis"
name of model to run
Optional
Default: "nvidia/diar_streaming_sortformer_4spk-v2.1"
sample rate of the audio
Optional
Default: 16000
Size of the search window
Optional
Default: 5
Path to audio file. Optional
Optional
Default: null
Size of the chunks to divide the audio. -1 for full audio
Optional
Default: -1
Configuration example
Generated from documented defaults. Replace any placeholders and complete required nested settings before running.
templates:
- template_name: "SinapsisSortformerDiarizer"
class_name: "SinapsisSortformerDiarizer"
attributes:
device: "cuda"
root_dir: "/home/ariel/.cache/sinapsis"
model_name: "nvidia/diar_streaming_sortformer_4spk-v2.1"
sample_rate: 16000
search_window: 5
audio_file_path: null
chunk_size_in_secs: -1
Inheritance
sinapsis_diarization.templates.base_diarizer_template.SinapsisBaseDiarizerEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.