Voice Activity Detection
NeMo
Safetensors
GGUF
Transformers
nemotron3_diarization
audio-frame-classification
speaker-diarization
streaming-sortformer
speaker-tagging
Run this model with HF Jobs
Run nvidia/Nemotron-3-Diarization on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/nvidia/Nemotron-3-Diarization. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/nvidia/Nemotron-3-Diarization on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use nvidia/Nemotron-3-Diarization with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- NeMo
How to use nvidia/Nemotron-3-Diarization with NeMo:
# tag did not correspond to a valid NeMo domain.
- Transformers
How to use nvidia/Nemotron-3-Diarization with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForAudioFrameClassification processor = AutoProcessor.from_pretrained("nvidia/Nemotron-3-Diarization") model = AutoModelForAudioFrameClassification.from_pretrained("nvidia/Nemotron-3-Diarization", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload ASR_INTEGRATION_GUIDE.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187# Use Nemotron-3-Diarization with Streaming ASR
`nvidia/Nemotron-3-Diarization` answers **who spoke when**. To produce aspeaker-attributed transcript—**who said what**—pair it with a compatible ASRmodel.
The recommended overlap-aware pairing is:
- Diarization: [`nvidia/Nemotron-3-Diarization`](https://huggingface.co/nvidia/Nemotron-3-Diarization)- ASR: [`nvidia/multitalker-parakeet-streaming-0.6b-v1`](https://huggingface.co/nvidia/multitalker-parakeet-streaming-0.6b-v1)- Integration: NeMo Speech's [`speech_to_text_multitalker_streaming_infer.py`](https://github.com/NVIDIA-NeMo/Speech/blob/main/examples/asr/asr_cache_aware_streaming/speech_to_text_multitalker_streaming_infer.py)
This is a coupled streaming pipeline. Sortformer produces speaker activity foreach frame, and Multitalker Parakeet uses that activity to focus an ASR streamon each speaker. All ASR streams receive the same mixed audio. This is importantfor overlapping speech: independently transcribing diarization time ranges doesnot isolate speakers when two people are talking at once.
## 1. Install NeMo Speech
Use a recent checkout of NeMo Speech because the multi-talker streaming helperis developed alongside the models.
```bashapt-get update && apt-get install -y libsndfile1 ffmpeg git
git clone --branch main --single-branch https://github.com/NVIDIA-NeMo/Speech.gitcd Speech
curl -LsSf https://astral.sh/uv/install.sh | shuv sync --python 3.13 --extra asr --extra cu13 --no-devsource .venv/bin/activate```
Use `--extra cu12` instead of `--extra cu13` when your installed NVIDIA driverand CUDA environment require CUDA 12.
If the Hugging Face repositories require authentication, provide a token thathas access to both models:
```bashexport HF_TOKEN="your-hugging-face-token"```
Do not put the token in source code or commit it to a repository.
## 2. Prepare the audio
The paired models expect single-channel, 16 kHz audio. Convert other inputsbefore inference:
```bashffmpeg -i input.mp3 -ac 1 -ar 16000 -c:a pcm_s16le conversation.wav```
## 3. Run speaker-attributed transcription
From the NeMo Speech repository root, run:
```bashpython examples/asr/asr_cache_aware_streaming/speech_to_text_multitalker_streaming_infer.py \ asr_model=nvidia/multitalker-parakeet-streaming-0.6b-v1 \ diar_model=nvidia/Nemotron-3-Diarization \ audio_file=/absolute/path/to/conversation.wav \ max_num_of_spks=8 \ single_speaker_mode=false \ masked_asr=false \ parallel_speaker_strategy=true \ cache_gating=true \ binary_diar_preds=true \ att_context_size='[70,13]' \ fifo_len=264 \ spkcache_update_period=64 \ generate_realtime_scripts=false \ output_path=./speaker_attributed_output.json```
The script prints streaming hypotheses and writes the final result to`speaker_attributed_output.json` in NeMo's SegLST format. Each finalized itemcontains its text, time range, and anonymous speaker label.
The important settings are:
| Setting | Meaning ||---|---|| `max_num_of_spks=8` | Maximum number of speaker streams maintained for the session. Lower this when the use case has fewer speakers to reduce compute. || `parallel_speaker_strategy=true` | Processes the speaker-specific ASR streams in parallel. || `masked_asr=false` | Uses speaker activity as conditioning for Multitalker Parakeet rather than simply muting the mixed waveform outside one speaker's regions. || `att_context_size='[70,13]'` | Uses 70 left-context frames and 13 right-context frames. With the model's current geometry, the streaming advance is about 1.12 seconds. || `cache_gating=true` | Stabilizes speaker-cache updates during streaming. || `spkcache_update_period=64` | Refreshes the speaker cache frequently enough for the long, eight-speaker sessions used by this demo. Tune this for other workloads. |
`max_num_of_spks` is an upper bound, not a promise that every configured speakerwill appear. The diarization model discovers active speaker identities from theaudio.
## 4. Minimal Python usage in this demo repository
This repository wraps the same NeMo integration in `init_nemo_models.py`. Thewrapper loads both models, validates that their feature-frame strides arecompatible, configures Sortformer to match the ASR encoder, and maintains thestreaming state.
Run the following from this demo's directory:
```pythonfrom init_nemo_models import MultitalkerTranscriptionConfig, StreamingSession
config = MultitalkerTranscriptionConfig( diar_model="nvidia/Nemotron-3-Diarization", asr_model="nvidia/multitalker-parakeet-streaming-0.6b-v1", device="cuda", sample_rate=16000, max_num_of_spks=8, att_context_size=[70, 13], parallel_speaker_strategy=True, masked_asr=False, cache_gating=True, binary_diar_preds=True, spkcache_update_period=64, fifo_len=264,)
session = StreamingSession()session.setup_streaming_session(config)session.add_file_to_streaming_buffer("/path/to/conversation.wav")
for chunk_audio, chunk_lengths in session.streaming_buffer_iter: session.process_audio_chunk(chunk_audio, chunk_lengths)
print(session.transcribed_speaker_texts)```
A typical rendered result looks like:
```textSpeaker 0: Welcome, everyone. Let us begin.Speaker 1: I have the latest numbers.Speaker 2: I agree, but there is one remaining issue.```
Speaker numbers represent identities discovered during that stream. They do notidentify real-world names. If an application displays names, it must associatethose names separately—for example through an enrollment or application-levelmapping step.
## Real-time microphone or service integration
For live audio, keep one `StreamingSession` for each client connection and feedsuccessive mono PCM chunks to `process_microphone_chunk(audio, sample_rate)`.Do not share the session object between clients: the speaker cache, ASR decoderstate, timestamps, and transcript history are all session-specific.
Model weights may be shared across connections to save GPU memory, providedeach connection receives independent `SpeakerTaggedASR`, streaming-buffer, andspeaker-cache state. The service in this repository follows that pattern.
## Choosing another ASR model
A conventional single-speaker ASR can be applied after diarization by cuttingthe audio at each speaker segment and transcribing the cuts. That approach isreasonable when speakers rarely overlap. It is not an equivalent replacementfor Multitalker Parakeet: an extracted time range still contains every voicethat overlaps it, so a conventional ASR may merge or select the wrong speaker'swords.
For overlap-aware speaker-attributed transcription, use an ASR model designedto consume speaker activity and verify that its encoder frame geometry iscompatible with the diarization model.
## Troubleshooting
- **Only plain text appears:** Ensure you launched the multi-talker inference script with both `asr_model` and `diar_model`, rather than calling `asr_model.transcribe()` by itself.- **A model cannot be downloaded:** Accept any required model terms and verify that `HF_TOKEN` can read both repositories.- **Audio is rejected or results are poor:** Convert it to mono, 16-bit PCM at 16 kHz.- **CUDA out of memory:** Reduce `max_num_of_spks`. The multi-talker architecture maintains speaker-specific ASR state, so memory and compute grow with the number of simultaneous speaker streams.- **Speaker labels change after reconnecting:** Labels are session-local and are not biometric identities.- **Streaming parameters fail validation:** Start with the configuration above. The ASR and diarization chunk geometry must remain aligned; do not tune each model independently.ASR_INTEGRATION_GUIDE.mdAdded+187