Spaces:
Running
Running
Update dl.py
Browse files
dl.py
CHANGED
@@ -119,7 +119,14 @@ def show_f2(repo,name,token):
|
|
119 |
|
120 |
def show_f_cont(repo,name,file,token):
|
121 |
r = requests.get(f'https://huggingface.co/spaces/{repo}/{name}/raw/main/{file}')
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
|
125 |
|
@@ -240,7 +247,7 @@ with gr.Blocks() as build:
|
|
240 |
show_all_btn2.click(show_all_z,[r_name,token],files)
|
241 |
|
242 |
s_btn.click(show_s,[r_name,token],s_name)
|
243 |
-
f_name.change(show_f_cont,[r_name,s_name,f_name],r_h)
|
244 |
#s_name.change(show_f,[r_name,s_name,token],[d_app,files])
|
245 |
l_btn.click(show_f,[r_name,s_name,token], [f_name, files])
|
246 |
|
|
|
119 |
|
120 |
def show_f_cont(repo,name,file,token):
|
121 |
r = requests.get(f'https://huggingface.co/spaces/{repo}/{name}/raw/main/{file}')
|
122 |
+
text=r.text
|
123 |
+
html_text = '<html>\n<body>\n'
|
124 |
+
|
125 |
+
for line in text.split('\n'):
|
126 |
+
html_text += f'<p>{line}</p>\n'
|
127 |
+
|
128 |
+
html_text += '</body>\n</html>'
|
129 |
+
return(html_text,r.text)
|
130 |
|
131 |
|
132 |
|
|
|
247 |
show_all_btn2.click(show_all_z,[r_name,token],files)
|
248 |
|
249 |
s_btn.click(show_s,[r_name,token],s_name)
|
250 |
+
f_name.change(show_f_cont,[r_name,s_name,f_name],[r_h,r_t)
|
251 |
#s_name.change(show_f,[r_name,s_name,token],[d_app,files])
|
252 |
l_btn.click(show_f,[r_name,s_name,token], [f_name, files])
|
253 |
|