Omnibus commited on
Commit
27ae1cd
1 Parent(s): c1705c4

Update dl.py

Browse files
Files changed (1) hide show
  1. dl.py +3 -3
dl.py CHANGED
@@ -7,14 +7,13 @@ import json
7
  from zipfile import ZipFile
8
  import shutil
9
  from pathlib import Path
10
- from huggingface_hub import (create_repo,get_full_repo_name,upload_file,CommitOperationAdd,HfApi)
11
  uid = uuid.uuid4()
12
  #token = os.environ['HF_TOKEN']
13
  #token_self = os.environ['HF_TOKEN']
14
  #o=os.environ['P']
15
 
16
 
17
-
18
  def show_s(name,token):
19
  spaces=[]
20
  spaces.append("")
@@ -74,7 +73,8 @@ def show_all(author,token):
74
  #print (f_ist)
75
  if not os.path.exists(space_ea):
76
  os.makedirs(space_ea)
77
-
 
78
  for d_app in f_ist:
79
 
80
  r = requests.get(f'https://huggingface.co/spaces/{author}/{space_ea}/raw/main/{d_app}')
 
7
  from zipfile import ZipFile
8
  import shutil
9
  from pathlib import Path
10
+ from huggingface_hub import (create_repo,get_full_repo_name,upload_file,CommitOperationAdd,HfApi,snapshot_download)
11
  uid = uuid.uuid4()
12
  #token = os.environ['HF_TOKEN']
13
  #token_self = os.environ['HF_TOKEN']
14
  #o=os.environ['P']
15
 
16
 
 
17
  def show_s(name,token):
18
  spaces=[]
19
  spaces.append("")
 
73
  #print (f_ist)
74
  if not os.path.exists(space_ea):
75
  os.makedirs(space_ea)
76
+ file= snapshot_download(repo_id=f'{author}/{space_ea}', repo_type="space")
77
+ return file
78
  for d_app in f_ist:
79
 
80
  r = requests.get(f'https://huggingface.co/spaces/{author}/{space_ea}/raw/main/{d_app}')