yinruiqing / pyannote-whisper

529 stars 91 forks source link

Huggingface token #26

Open tonyphoang opened 7 months ago

tonyphoang commented 7 months ago

Hi all,

I got this error:

It might be because the pipeline is private or gated so make
sure to authenticate. Visit https://hf.co/settings/tokens to
create your access token and retry with:

   >>> Pipeline.from_pretrained('pyannote/speaker-diarization',
   ...                          use_auth_token=YOUR_AUTH_TOKEN)

My code: My hf token is taken from https://hf.co/settings/tokens


import whisper
from pyannote.audio import Pipeline
from pyannote.audio import Audio
from pyannote_whisper.utils import diarize_text
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization",
                                    use_auth_token=hf)
model = whisper.load_model("tiny.en")
diarization_result = pipeline("data/afjiv.wav")

from pyannote.audio import Audio
audio = Audio(sample_rate=16000, mono=True)
audio_file = "data/afjiv.wav"
for segment, _, speaker in diarization_result.itertracks(yield_label=True):
    waveform, sample_rate = audio.crop(audio_file, segment)
    text = model.transcribe(waveform.squeeze().numpy())["text"]
    print(f"{segment.start:.2f}s {segment.end:.2f}s {speaker}: {text}")

I have accepted the terms on hugging face (https://huggingface.co/pyannote/speaker-diarization):

Gated model
You have been granted access to this model
mces89 commented 6 months ago

got the same error

Choi-YoungHyun commented 6 months ago

I was experienced same error So, I delete exist token and make New token [caution] type is read