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):