yonikremer commited on
Commit
fca1dff
1 Parent(s): 9c8dd72

specified caching dir

Browse files
Files changed (1) hide show
  1. download_repo.py +5 -1
download_repo.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import urllib3
2
 
3
  from huggingface_hub import snapshot_download
@@ -17,10 +19,12 @@ def download_repository(name: str) -> None:
17
  """Downloads a repository from the Hugging Face Hub."""
18
  number_of_seconds_in_a_day: int = 86_400
19
  change_default_timeout(number_of_seconds_in_a_day)
 
20
  snapshot_download(
 
21
  repo_id=name,
22
  etag_timeout=number_of_seconds_in_a_day,
23
  resume_download=True,
24
  repo_type="model",
25
  library_name="pytorch"
26
- )
 
1
+ import os
2
+
3
  import urllib3
4
 
5
  from huggingface_hub import snapshot_download
 
19
  """Downloads a repository from the Hugging Face Hub."""
20
  number_of_seconds_in_a_day: int = 86_400
21
  change_default_timeout(number_of_seconds_in_a_day)
22
+ curr_folder: str = os.path.dirname(__path__)
23
  snapshot_download(
24
+ cache_dir=os.path.join(curr_folder, "huggingface", "models"),
25
  repo_id=name,
26
  etag_timeout=number_of_seconds_in_a_day,
27
  resume_download=True,
28
  repo_type="model",
29
  library_name="pytorch"
30
+ )