Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add progress hooks in README.md example #1826

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Consider switching to [pyannoteAI](https://www.pyannote.ai) for better and faste

```python
from pyannote.audio import Pipeline
from pyannote.audio.pipelines.utils.hook import Hooks, ProgressHook, TimingHook

pipeline = Pipeline.from_pretrained(
"pyannote/speaker-diarization-3.1",
use_auth_token="HUGGINGFACE_ACCESS_TOKEN_GOES_HERE")
Expand All @@ -27,7 +29,8 @@ import torch
pipeline.to(torch.device("cuda"))

# apply pretrained pipeline
diarization = pipeline("audio.wav")
with Hooks(ProgressHook(), TimingHook()) as hook:
diarization = pipeline("audio.wav", hook=hook)

# print the result
for turn, _, speaker in diarization.itertracks(yield_label=True):
Expand Down