Spaces:
Running
Running
Update dl.py
Browse files
dl.py
CHANGED
@@ -29,7 +29,7 @@ def show_s(name,token):
|
|
29 |
|
30 |
def show_f(repo,name,token):
|
31 |
api = HfApi(token=token)
|
32 |
-
f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="space"))
|
33 |
print (f_ist)
|
34 |
file_list = []
|
35 |
file_out = []
|
@@ -153,13 +153,16 @@ with gr.Blocks() as build:
|
|
153 |
with gr.Row():
|
154 |
r_name = gr.Textbox(label="Repo")
|
155 |
token = gr.Textbox(label="auth")
|
156 |
-
|
|
|
157 |
with gr.Row():
|
158 |
s_name = gr.Dropdown(label="Spaces", choices=[])
|
159 |
d_app = gr.Dropdown(label="Files", choices=[])
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
|
|
163 |
|
164 |
gr.Column(scale=1)
|
165 |
files=gr.File(file_count="directory")
|
@@ -172,7 +175,7 @@ with gr.Blocks() as build:
|
|
172 |
show_all_btn2.click(show_all_z,[r_name,token],files)
|
173 |
|
174 |
s_btn.click(show_s,[r_name,token],s_name)
|
175 |
-
s_name.change(show_f,[r_name,s_name,token],[d_app,files])
|
176 |
l_btn.click(show_f,[r_name,s_name,token], [d_app, files])
|
177 |
|
178 |
pass_btn.click(checkp,pass_box,[no,yes])
|
|
|
29 |
|
30 |
def show_f(repo,name,token):
|
31 |
api = HfApi(token=token)
|
32 |
+
f_ist = (api.list_repo_files(repo_id=f'{repo}/{name[0]}', repo_type="space"))
|
33 |
print (f_ist)
|
34 |
file_list = []
|
35 |
file_out = []
|
|
|
153 |
with gr.Row():
|
154 |
r_name = gr.Textbox(label="Repo")
|
155 |
token = gr.Textbox(label="auth")
|
156 |
+
with gr.Row():
|
157 |
+
s_btn = gr.Button("Show")
|
158 |
with gr.Row():
|
159 |
s_name = gr.Dropdown(label="Spaces", choices=[])
|
160 |
d_app = gr.Dropdown(label="Files", choices=[])
|
161 |
+
with gr.Row():
|
162 |
+
l_btn = gr.Button("Load Space")
|
163 |
+
with gr.Row():
|
164 |
+
show_all_btn1 = gr.Button("Load All 1")
|
165 |
+
show_all_btn2 = gr.Button("Load All 2")
|
166 |
|
167 |
gr.Column(scale=1)
|
168 |
files=gr.File(file_count="directory")
|
|
|
175 |
show_all_btn2.click(show_all_z,[r_name,token],files)
|
176 |
|
177 |
s_btn.click(show_s,[r_name,token],s_name)
|
178 |
+
#s_name.change(show_f,[r_name,s_name,token],[d_app,files])
|
179 |
l_btn.click(show_f,[r_name,s_name,token], [d_app, files])
|
180 |
|
181 |
pass_btn.click(checkp,pass_box,[no,yes])
|