speakerbox icon indicating copy to clipboard operation
speakerbox copied to clipboard

apply._diarize() does not allow for specification of Hugging Face token

Open gregoryfoster opened this issue 2 years ago • 2 comments

Describe the Bug

The apply() function fails as a Hugging Face token is not supplied. The contained _diarize() function calls:

diarization_pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")

This results in an error indicating the pipeline is private/gated.

Expected Behavior

The HUGGINGFACE_TOKEN environment variable is not utilized as it is in preprocess.diarize_and_split_audio().

Reproduction

pipenv install speakerbox=1.2.0 Executive script which calls apply() function with a trained model.

Environment

  • OS Version: macOS 13.4
  • Python: 3.10.13
  • speakerbox Version: 1.2.0

gregoryfoster avatar Nov 17 '23 01:11 gregoryfoster

I'd be happy to submit a pull request which replicates usage of the HUGGINGFACE_TOKEN environment variable and optionally allows for provision of hf_token directly to the apply() function, but could use some guidance on where you'd like to centralize that environment variable handling code so it's not repeated.

gregoryfoster avatar Nov 17 '23 01:11 gregoryfoster

Hey @gregoryfoster ! Sorry for the delay.

Dangit, sorry you are having so much trouble getting this up and running, seems like I really let this project get to a point of low sustainability.

If you made a pull request that placed a function in the utils.py file link, that centralized the hf_token handling code, I would gladly accept it!

evamaxfield avatar Nov 20 '23 23:11 evamaxfield