xp3857 commited on
Commit
90d3d82
·
1 Parent(s): 870c070

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -81,20 +81,17 @@ def get_f(r_name,spaces,token):
81
  api = HfApi(token=token)
82
  spaces_b=[]
83
  files_b=[]
84
- spaces=spaces.replace("[","").replace("]","").replace("'","")
85
  spaces=spaces.split(",")
86
  print (spaces)
87
 
88
- for b in spaces:
89
- print(f"a-{b}")
90
- print(b)
91
- #print(space)
92
- f_ist = (api.list_repo_files(repo_id=f'{r_name}/{b}', repo_type="space"))
93
- sp = b
94
- for f in f_ist:
95
- print("b")
96
- r = requests.get(f'https://huggingface.co/spaces/{r_name}/{sp}/raw/main/{f}')
97
- print(f)
98
  #with zipfile.ZipFile('new.zip', 'w') as new_zip:
99
  # new_zip.write('spam.txt', compress_type=zipfile.ZIP_DEFLATED)
100
 
 
81
  api = HfApi(token=token)
82
  spaces_b=[]
83
  files_b=[]
84
+ spaces=spaces.replace("[","").replace("]","").replace("'","").replace(" ","")
85
  spaces=spaces.split(",")
86
  print (spaces)
87
 
88
+ for space in spaces:
89
+ print(space)
90
+ print("###############")
91
+ f_ist = (api.list_repo_files(repo_id=f'{r_name}/{space}', repo_type="space"))
92
+ for file in f_ist:
93
+ r = requests.get(f'https://huggingface.co/spaces/{r_name}/{space}/raw/main/{file}')
94
+ print(file)
 
 
 
95
  #with zipfile.ZipFile('new.zip', 'w') as new_zip:
96
  # new_zip.write('spam.txt', compress_type=zipfile.ZIP_DEFLATED)
97