Omnibus commited on
Commit
5ce820e
1 Parent(s): 0576fb0

Update dl.py

Browse files
Files changed (1) hide show
  1. dl.py +8 -0
dl.py CHANGED
@@ -58,6 +58,13 @@ def show_f(repo,name,token):
58
 
59
  return(gr.Dropdown.update(label="Files", choices=[f for f in f_ist],interactive=True), file_list)
60
 
 
 
 
 
 
 
 
61
  def show_all(author,token):
62
  spaces=[]
63
  api = HfApi(token=token)
@@ -174,6 +181,7 @@ with gr.Blocks() as build:
174
  show_all_btn2.click(show_all_z,[r_name,token],files)
175
 
176
  s_btn.click(show_s,[r_name,token],s_name)
 
177
  #s_name.change(show_f,[r_name,s_name,token],[d_app,files])
178
  l_btn.click(show_f,[r_name,s_name,token], [d_app, files])
179
 
 
58
 
59
  return(gr.Dropdown.update(label="Files", choices=[f for f in f_ist],interactive=True), file_list)
60
 
61
+
62
+ def show_f_cont(repo,name,file,token):
63
+ r = requests.get(f'https://huggingface.co/spaces/{repo}/{name}/raw/main/{file}')
64
+ return(r.text)
65
+
66
+
67
+
68
  def show_all(author,token):
69
  spaces=[]
70
  api = HfApi(token=token)
 
181
  show_all_btn2.click(show_all_z,[r_name,token],files)
182
 
183
  s_btn.click(show_s,[r_name,token],s_name)
184
+ f_name.change(show_f_cont,[r_name,s_name,f_name],r_t)
185
  #s_name.change(show_f,[r_name,s_name,token],[d_app,files])
186
  l_btn.click(show_f,[r_name,s_name,token], [d_app, files])
187