From 15b954c35e1a8cbfe2055d55d835d5e18c8def1d Mon Sep 17 00:00:00 2001 From: Ilya Gulya Date: Fri, 10 Jan 2025 11:21:33 +0500 Subject: [PATCH] doc: add progress hooks in README.md example --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 79a203588..7e0a462e3 100644 --- a/README.md +++ b/README.md @@ -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") @@ -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):