Update app.py
Browse files
app.py
CHANGED
|
@@ -47,21 +47,8 @@ def show_f(repo,name,token):
|
|
| 47 |
api = HfApi(token=token)
|
| 48 |
f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="space"))
|
| 49 |
print (f_ist)
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
file_j.close()
|
| 53 |
-
file_b = open('tmp_f','r')
|
| 54 |
-
r_file = file_b.readlines()
|
| 55 |
-
files=[]
|
| 56 |
-
files.append("")
|
| 57 |
-
for line in r_file:
|
| 58 |
-
if "'id':" in line:
|
| 59 |
-
line = line.split(":",1)[1]
|
| 60 |
-
line = line.split("/",1)[1]
|
| 61 |
-
line = line.replace("'","").replace(",","").replace("\n","")
|
| 62 |
-
files.append(line)
|
| 63 |
-
print(f"{line}")
|
| 64 |
-
return(gr.Dropdown.update(label="Spaces", choices=[f for f in files]))
|
| 65 |
|
| 66 |
|
| 67 |
|
|
|
|
| 47 |
api = HfApi(token=token)
|
| 48 |
f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="space"))
|
| 49 |
print (f_ist)
|
| 50 |
+
|
| 51 |
+
return(gr.Dropdown.update(label="Spaces", choices=[f for f in f_ist]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
|
| 54 |
|