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

Huggingface token #26

Open
tonyphoang opened this issue May 5, 2024 · 2 comments
Open

Huggingface token #26

tonyphoang opened this issue May 5, 2024 · 2 comments

Comments

@tonyphoang
Copy link

tonyphoang commented May 5, 2024

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
Copy link

mces89 commented May 13, 2024

got the same error

@Choi-YoungHyun
Copy link

Choi-YoungHyun commented Jun 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants