Use cache_dir instead of local_dir (#182)

* Use cache_dir instead of local_dir

* Fix unit test

* Use cache_dir and preserve local_dir parameter

* Remove blank line at the end

* Disable ut

* Implement  download_root suggestion

* Use cache_dir=download_root
This commit is contained in:
Jordi Mas
2023-04-26 16:35:18 +02:00
committed by GitHub
parent 67cce3f552
commit 68df3214ba
3 changed files with 14 additions and 1 deletions

View File

@@ -15,3 +15,9 @@ def test_download_model(tmpdir):
for filename in os.listdir(model_dir):
path = os.path.join(model_dir, filename)
assert not os.path.islink(path)
def test_download_model_in_cache(tmpdir):
cache_dir = str(tmpdir.join("model"))
download_model("tiny", cache_dir=cache_dir)
assert os.path.isdir(cache_dir)