Remove --no-cache-dir when downloading models

When `--no-cache-dir` is present, it prevents caching to properly function.

If the user still wants to do this, there is the possibility to pass options with `user_pip_args`.
But you should not enforce options like these. In my case this is preventing some docker build (using buildkit caching) to have proper caching of models.
This commit is contained in:
Pamphile ROY 2021-01-29 15:37:44 +01:00 committed by GitHub
parent 4096a79de7
commit 41ee75ac6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,8 +128,6 @@ def get_version(model, comp):
def download_model(filename, user_pip_args=None):
download_url = about.__download_url__ + "/" + filename
pip_args = ["--no-cache-dir"]
if user_pip_args:
pip_args.extend(user_pip_args)
pip_args = user_pip_args if user_pip_args is not None else []
cmd = [sys.executable, "-m", "pip", "install"] + pip_args + [download_url]
return subprocess.call(cmd, env=os.environ.copy())