Update app.py
Browse files
app.py
CHANGED
|
@@ -75,17 +75,19 @@ def repl(rs,rt,uu):
|
|
| 75 |
return r_file, f'mod_{uu}'
|
| 76 |
|
| 77 |
def get_f(r_name,spaces,token):
|
|
|
|
| 78 |
api = HfApi(token=token)
|
| 79 |
spaces_b=[]
|
| 80 |
files_b=[]
|
| 81 |
-
for
|
| 82 |
-
print(f"a-{
|
| 83 |
-
print(spaces[
|
| 84 |
#print(space)
|
| 85 |
-
f_ist = (api.list_repo_files(repo_id=f'{r_name}/{spaces[
|
|
|
|
| 86 |
for i in f_ist:
|
| 87 |
print("b")
|
| 88 |
-
r = requests.get(f'https://huggingface.co/spaces/{r_name}/{
|
| 89 |
print(f_ist[i])
|
| 90 |
#with zipfile.ZipFile('new.zip', 'w') as new_zip:
|
| 91 |
# new_zip.write('spam.txt', compress_type=zipfile.ZIP_DEFLATED)
|
|
@@ -165,7 +167,7 @@ with gr.Blocks() as build:
|
|
| 165 |
with gr.Row():
|
| 166 |
r_t=gr.Textbox(max_lines=100)
|
| 167 |
m_t=gr.Textbox(max_lines=100)
|
| 168 |
-
au=gr.Textbox(visible=
|
| 169 |
uu=gr.Textbox(visible=False)
|
| 170 |
|
| 171 |
def cyc(x):
|
|
|
|
| 75 |
return r_file, f'mod_{uu}'
|
| 76 |
|
| 77 |
def get_f(r_name,spaces,token):
|
| 78 |
+
print(f"spz-{spaces}")
|
| 79 |
api = HfApi(token=token)
|
| 80 |
spaces_b=[]
|
| 81 |
files_b=[]
|
| 82 |
+
for i in spaces:
|
| 83 |
+
print(f"a-{i}")
|
| 84 |
+
print(spaces[i])
|
| 85 |
#print(space)
|
| 86 |
+
f_ist = (api.list_repo_files(repo_id=f'{r_name}/{spaces[i]}', repo_type="space"))
|
| 87 |
+
sp = spaces[i]
|
| 88 |
for i in f_ist:
|
| 89 |
print("b")
|
| 90 |
+
r = requests.get(f'https://huggingface.co/spaces/{r_name}/{sp}/raw/main/{f_ist[i]}')
|
| 91 |
print(f_ist[i])
|
| 92 |
#with zipfile.ZipFile('new.zip', 'w') as new_zip:
|
| 93 |
# new_zip.write('spam.txt', compress_type=zipfile.ZIP_DEFLATED)
|
|
|
|
| 167 |
with gr.Row():
|
| 168 |
r_t=gr.Textbox(max_lines=100)
|
| 169 |
m_t=gr.Textbox(max_lines=100)
|
| 170 |
+
au=gr.Textbox(visible=True)
|
| 171 |
uu=gr.Textbox(visible=False)
|
| 172 |
|
| 173 |
def cyc(x):
|