doc: fix diarize import in example script (#1192)
This commit is contained in:
@@ -166,6 +166,7 @@ See more examples in other languages [here](EXAMPLES.md).
|
|||||||
```python
|
```python
|
||||||
import whisperx
|
import whisperx
|
||||||
import gc
|
import gc
|
||||||
|
from whisperx.diarize import DiarizationPipeline
|
||||||
|
|
||||||
device = "cuda"
|
device = "cuda"
|
||||||
audio_file = "audio.mp3"
|
audio_file = "audio.mp3"
|
||||||
@@ -196,7 +197,7 @@ print(result["segments"]) # after alignment
|
|||||||
# import gc; import torch; gc.collect(); torch.cuda.empty_cache(); del model_a
|
# import gc; import torch; gc.collect(); torch.cuda.empty_cache(); del model_a
|
||||||
|
|
||||||
# 3. Assign speaker labels
|
# 3. Assign speaker labels
|
||||||
diarize_model = whisperx.diarize.DiarizationPipeline(use_auth_token=YOUR_HF_TOKEN, device=device)
|
diarize_model = DiarizationPipeline(use_auth_token=YOUR_HF_TOKEN, device=device)
|
||||||
|
|
||||||
# add min/max number of speakers if known
|
# add min/max number of speakers if known
|
||||||
diarize_segments = diarize_model(audio)
|
diarize_segments = diarize_model(audio)
|
||||||
|
|||||||
Reference in New Issue
Block a user