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

Getting HFValidationError when loading SpeakerDiarization pipeline #1312

Closed
Skydddoogg opened this issue Apr 3, 2023 · 2 comments
Closed

Comments

@Skydddoogg
Copy link

Skydddoogg commented Apr 3, 2023

I'm trying to load the SpeakerDiarization pipeline as follows:

from pyannote.audio.pipelines import SpeakerDiarization
import pickle

with open(model_path, 'rb') as handle:
    model = pickle.load(handle)
    model.eval()

pipeline = SpeakerDiarization(segmentation=model)

The above code works well on a ubuntu user (assumed A). However, it raises the error below when trying on another user under the same machine (assumed B):

  File "test.py", line 18, in load_pipeline
    pipeline = SpeakerDiarization(segmentation=model)
  File "/home/sky/miniconda3/envs/pyannote/lib/python3.8/site-packages/pyannote/audio/pipelines/speaker_diarization.py", line 163, in __init__
    self._embedding = PretrainedSpeakerEmbedding(
  File "/home/sky/miniconda3/envs/pyannote/lib/python3.8/site-packages/pyannote/audio/pipelines/speaker_verification.py", line 463, in PretrainedSpeakerEmbedding
    return SpeechBrainPretrainedSpeakerEmbedding(
  File "/home/sky/miniconda3/envs/pyannote/lib/python3.8/site-packages/pyannote/audio/pipelines/speaker_verification.py", line 242, in __init__
    self.classifier_ = SpeechBrain_EncoderClassifier.from_hparams(
  File "/home/sky/miniconda3/envs/pyannote/lib/python3.8/site-packages/speechbrain/pretrained/interfaces.py", line 367, in from_hparams
    hparams_local_path = fetch(
  File "/home/sky/miniconda3/envs/pyannote/lib/python3.8/site-packages/speechbrain/pretrained/fetching.py", line 120, in fetch
    fetched_file = huggingface_hub.hf_hub_download(
  File "/home/sky/miniconda3/envs/pyannote/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 112, in _inner_fn
    validate_repo_id(arg_value)
  File "/home/sky/miniconda3/envs/pyannote/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 166, in validate_repo_id
    raise HFValidationError(
huggingface_hub.utils._validators.HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: 'speechbrain/spkrec-ecapa-voxceleb@5c0be3875fda05e81f3c004ed8c7c06be308de1e'.

This is so weird since it works on A but not on B. Any help would be appreciated.

Note that I use the following instructions to create the conda environment on both users:

conda create -n pyannote python=3.8
conda activate pyannote

# pytorch 1.11 is required for speechbrain compatibility
# (see https://pytorch.org/get-started/previous-versions/#v1110)
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 -c pytorch

pip install pyannote.audio
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@Skydddoogg
Copy link
Author

I fixed it by changing self.embedding to "speechbrain/spkrec-ecapa-voxceleb". By doing so, the program downloaded some necessary files and worked like a charm! I tried changing it to the default and the program still worked.

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

1 participant