question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make pretrained models download path configurable

See original GitHub issue

Is your feature request related to a problem? Please describe.

Directory where pretrained model is downloaded is hardcoded to cache_dir = Path.joinpath(Path.home(), f'.cache/torch/NeMo/NeMo_{nemo.__version__}/{filename[:-5]}') in https://github.com/NVIDIA/NeMo/blob/main/nemo/core/classes/common.py#L652. So model download fails in environments where $HOME is not writeable.

Describe the solution you’d like

Provide option to specify path to download pretrained model. May be via environment variable or a parameter?

Describe alternatives you’ve considered

To unblock myself, I have currently created a change in my fork to specify download path via environment variable. https://github.com/jarivk/NeMo/commit/f2e1c57e400b71ddcb0c76499c0cd7f29893ba9c

Additional context

None

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
titu1994commented, Jun 15, 2022

Hmm true it’s burried in documentation. You can use NEMO_CACHE_DIR=“SOME PATH” in your environment env (maybe bashrc or similar)

0reactions
sqrkcommented, Jun 15, 2022

This is now supported.

Hello! I understand that we can now change the location of default cache directory where the pre-trained models are downloaded to, is that correct? I can’t find how to do that in the documentation, could you help me with that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration - Hugging Face
The base class PretrainedConfig implements the common methods for loading/saving a configuration either from a local file or directory, or from a pretrained...
Read more >
Training Custom Object Detector
pre-trained -models : This folder will contain the downloaded pre-trained models, which shall be used as a starting checkpoint for our training jobs....
Read more >
PyTorch-Transformers
An open source machine learning framework that accelerates the path from research prototyping to production deployment.
Read more >
Load a pre-trained model from disk with Huggingface ...
When I check the link, I can download the following files: config.json , flax_model.msgpack , modelcard.json , pytorch_model.bin , tf_model.h5 , ...
Read more >
Solved: Error when use macro - Download pre-trained model
In any case please make sure that cuda 8 is installed properly (According to the logs you've attached the installation doesn't even start)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found