xp3857 commited on
Commit
f12b930
·
1 Parent(s): d6a90d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -80,7 +80,7 @@ def load_space(r_name,s_name,d_app):
80
  file.close()
81
  o_file = open(f'{uid}/mod_{d_app}','w')
82
  o_file.writelines(r.text)
83
- return r.text
84
  def load_space_d(r_name,s_name,d_app):
85
  print(f'https://huggingface.co/spaces/{r_name}/{s_name}/raw/main/{d_app}')
86
  r = requests.get(f'https://huggingface.co/spaces/{r_name}/{s_name}/raw/main/{d_app}')
@@ -208,16 +208,24 @@ with gr.Blocks() as build:
208
  with gr.Row():
209
  r_t=gr.Textbox(max_lines=100)
210
  m_t=gr.Textbox(max_lines=100)
 
 
 
 
 
 
211
  with gr.Tab("Dest"):
212
  with gr.Row():
213
- rd_t=gr.Textbox(max_lines=100)
214
- md_t=gr.Textbox(max_lines=100)
215
  au=gr.Textbox(visible=False)
216
  uu=gr.Textbox(visible=False)
217
 
218
  def cyc(x):
219
  return x,None
220
 
 
 
221
  f_btn.click(get_f,[r_name,ss_name,token],[a_files,z_files])
222
  r_t.change(cyc,r_t,[m_t,files])
223
 
@@ -229,7 +237,7 @@ with gr.Blocks() as build:
229
  s_btn.click(show_s,r_name,[s_name,ss_name])
230
  s_name.change(show_f,[r_name,s_name],d_app)
231
 
232
- l_btn.click(load_space,[r_name,s_name,d_app],[r_t])
233
  r_btn.click(repl,[r_s,r_w,d_app], [m_t,files])
234
 
235
  pass_btn.click(checkp,pass_box,[no,yes])
 
80
  file.close()
81
  o_file = open(f'{uid}/mod_{d_app}','w')
82
  o_file.writelines(r.text)
83
+ return r.text,r.text
84
  def load_space_d(r_name,s_name,d_app):
85
  print(f'https://huggingface.co/spaces/{r_name}/{s_name}/raw/main/{d_app}')
86
  r = requests.get(f'https://huggingface.co/spaces/{r_name}/{s_name}/raw/main/{d_app}')
 
208
  with gr.Row():
209
  r_t=gr.Textbox(max_lines=100)
210
  m_t=gr.Textbox(max_lines=100)
211
+ with gr.Tab("Mod Source"):
212
+ with gr.Row():
213
+ rm_but=gr.Button("Update Source")
214
+ with gr.Row():
215
+ rm_t=gr.Textbox(lines=30,max_lines=100,interactive=True)
216
+ mm_t=gr.Textbox(lins=30,max_lines=100)
217
  with gr.Tab("Dest"):
218
  with gr.Row():
219
+ rd_t=gr.Textbox(lines=30,max_lines=100)
220
+ md_t=gr.Textbox(lins=30,max_lines=100)
221
  au=gr.Textbox(visible=False)
222
  uu=gr.Textbox(visible=False)
223
 
224
  def cyc(x):
225
  return x,None
226
 
227
+ rm_but.click(cyc,rm_t,[r_t,mm_t])
228
+
229
  f_btn.click(get_f,[r_name,ss_name,token],[a_files,z_files])
230
  r_t.change(cyc,r_t,[m_t,files])
231
 
 
237
  s_btn.click(show_s,r_name,[s_name,ss_name])
238
  s_name.change(show_f,[r_name,s_name],d_app)
239
 
240
+ l_btn.click(load_space,[r_name,s_name,d_app],[r_t,rm_t])
241
  r_btn.click(repl,[r_s,r_w,d_app], [m_t,files])
242
 
243
  pass_btn.click(checkp,pass_box,[no,yes])