Environment variable undefined

I wrote the following code:
pipeline = Pipeline.from_pretrained(‘pyannote/speaker-diarization-3.1’, use_auth_token=‘hf_token’)
and got the following error message:
*** NameError: name ‘HF_HUB_ETAG_TIMEOUT’ is not defined
What should I do?

1 Like

This may get around it, but the fact that the error is occurring is strange.

import os
os.environ["HF_HUB_ETAG_TIMEOUT"] = 600
pipeline = Pipeline.from_pretrained(‘pyannote/speaker-diarization-3.1’, use_auth_token=‘hf_token’)

HF_HUB_ETAG_TIMEOUT
Integer value to define the number of seconds to wait for server response when fetching the latest metadata from a repo before downloading a file. If the request times out, huggingface_hub will default to the locally cached files. Setting a lower value speeds up the workflow for machines with a slow connection that have already cached files. A higher value guarantees the metadata call to succeed in more cases. Default to 10s.

Thank you! I tried your suggestion and I still get the same error :thinking:

1 Like

That’s strange… maybe the version of the surrounding libraries is old and causing errors. Please try the following.

pip install -U huggingface_hub transformers accelerate

Thank you. The problem was sloved. The problem was that I didn’t do the authentication properly… I didn’t realize I need to pass the token as password…

1 Like

Is that it! I’m glad it’s solved.:smile_cat: