Voice Activity Detection
pyannote.audio
pyannote
pyannote-audio-pipeline
audio
voice
speech
speaker
speaker-diarization
speaker-change-detection
overlapped-speech-detection
Instructions to use KIFF/pyannote-speaker-diarization-endpoint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- pyannote.audio
How to use KIFF/pyannote-speaker-diarization-endpoint with pyannote.audio:
from pyannote.audio import Pipeline pipeline = Pipeline.from_pretrained("KIFF/pyannote-speaker-diarization-endpoint") # inference on the whole file pipeline("file.wav") # inference on an excerpt from pyannote.core import Segment excerpt = Segment(start=2.0, end=5.0) from pyannote.audio import Audio waveform, sample_rate = Audio().crop("file.wav", excerpt) pipeline({"waveform": waveform, "sample_rate": sample_rate}) - Notebooks
- Google Colab
- Kaggle
auth fix + 3.0 version
#2
by timail - opened
- handler.py +3 -2
handler.py
CHANGED
|
@@ -15,9 +15,10 @@ class EndpointHandler():
|
|
| 15 |
raise ValueError("Hugging Face authentication token (MY_KEY) is missing.")
|
| 16 |
|
| 17 |
# Initialize the pipeline with the authentication token
|
|
|
|
| 18 |
self.pipeline = Pipeline.from_pretrained(
|
| 19 |
-
"pyannote/speaker-diarization-3.
|
| 20 |
-
|
| 21 |
|
| 22 |
# Move the pipeline to the appropriate device (CPU or GPU)
|
| 23 |
self.pipeline.to(torch.device("cuda" if torch.cuda.is_available() else "cpu"))
|
|
|
|
| 15 |
raise ValueError("Hugging Face authentication token (MY_KEY) is missing.")
|
| 16 |
|
| 17 |
# Initialize the pipeline with the authentication token
|
| 18 |
+
os.environ["HF_TOKEN"] = hf_token
|
| 19 |
self.pipeline = Pipeline.from_pretrained(
|
| 20 |
+
"pyannote/speaker-diarization-3.0", use_auth_token=True,
|
| 21 |
+
|
| 22 |
|
| 23 |
# Move the pipeline to the appropriate device (CPU or GPU)
|
| 24 |
self.pipeline.to(torch.device("cuda" if torch.cuda.is_available() else "cpu"))
|