Environment variable undefined
I wrote the following code:pipeline = Pipeline.from_pretrained(‘pyannote/speaker-diarization-3.1’, use_auth_token=‘REDACTED_TOKEN’)and got the following error message:*** NameError: name ‘HF_HUB_ETAG_TIMEOUT’ is not definedWhat should I do?
2025-01-01T03:18:09Z
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=‘REDACTED_TOKEN’)github.com/huggingface/huggingface_hubAdding the ability to configure etag timeout as env propertyopened11:10AM - 01 Oct 23 UTCclosed03:21PM - 12 Oct 23 UTCShahafgogood first issueHello HuggingFace Team!
I noticed that the etag_timeout in the snapshot_downloa…d request supports passing customized values but for some reason it was not in the pipeline and tokenizers of transformers and the timeout is set by default to 10 seconds without the ability to override and perhaps in another libraries as well.

This ability is important to me as I want to give the user the ability to configure the etag_timeout and because there is not an options to do so in tokenizer I have thought maybe it is a good idea to override the etag timeout for all the libraries (like in huggingface-cli) that use huggingface_hub.github.comhuggingface/huggingface_hub/blob/main/docs/source/en/package_reference/environment_variables.md<!--⚠️ Note that this file is in Markdown but contains specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
-->

# Environment variables

`huggingface_hub` can be configured using environment variables.

If you are unfamiliar with environment variable, here are generic articles about them
[on macOS and Linux](https://linuxize.com/post/how-to-set-and-list-environment-variables-in-linux/)
and on [Windows](https://phoenixnap.com/kb/windows-set-environment-variable).

This page will guide you through all environment variables specific to `huggingface_hub`
and their meaning.

## Generic

### HF_INFERENCE_ENDPOINT

To configure the inference api base url. You might want to set this variable if your organizationThis file has been truncated.show originalHF_HUB_ETAG_TIMEOUTInteger 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_hubwill 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.
2025-01-01T08:57:52Z
Thank you! I tried your suggestion and I still get the same error
2025-01-01T09:16:30Z
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
2025-01-01T10:15:46Z
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…
2025-01-01T10:19:37Z
Is that it! I’m glad it’s solved.