DemiPoto commited on
Commit
dc77275
·
verified ·
1 Parent(s): c7657d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -382,7 +382,7 @@ def fonc_start(id_session,id_module):
382
  return result
383
 
384
  def test_start(o):
385
- return gr.Image(None)
386
  #return None
387
  def test_change():
388
  print("go\n")
@@ -470,18 +470,21 @@ def make_me():
470
  with gr.Row():
471
  outputs=[]
472
  id_modules=[]
 
473
  for i in range(nb_req_simult.value):
474
  #outputs.append(gr.Image(None,interactive=False,render=False))
475
  #id_modules.append(gr.Number(i,interactive=False,render=False))
476
  outputs.append(gr.Image(None,interactive=False,visible=False))
477
  id_modules.append(gr.Number(i,interactive=False,visible=False))
 
478
  print(len(outputs))
479
  print(outputs[0])
480
- for o,i in zip(outputs,id_modules):
481
  #o.change(fonc_start,[id_session,i],[o])
482
- o.change(test_change,[],[])
 
483
  #button_start.click(lambda : gr.Image(None),[],[o])
484
- gen_event = gr.on(triggers=[button_start.click], fn=test_start,inputs=[o], outputs=[o])
485
 
486
  gallery = gr.Gallery(label="Output", show_download_button=True, elem_classes="gallery",
487
  interactive=False, show_share_button=True, container=True, format="png",
 
382
  return result
383
 
384
  def test_start(o):
385
+ return gr.Textbox(o+"1")
386
  #return None
387
  def test_change():
388
  print("go\n")
 
470
  with gr.Row():
471
  outputs=[]
472
  id_modules=[]
473
+ states=[]
474
  for i in range(nb_req_simult.value):
475
  #outputs.append(gr.Image(None,interactive=False,render=False))
476
  #id_modules.append(gr.Number(i,interactive=False,render=False))
477
  outputs.append(gr.Image(None,interactive=False,visible=False))
478
  id_modules.append(gr.Number(i,interactive=False,visible=False))
479
+ states.append(gr.Textbox(" ",interactive=False,visible=False))
480
  print(len(outputs))
481
  print(outputs[0])
482
+ for o,i,s in zip(outputs,id_modules,states):
483
  #o.change(fonc_start,[id_session,i],[o])
484
+ #o.change(test_change,[],[])
485
+ s.change(test_change,[],[])
486
  #button_start.click(lambda : gr.Image(None),[],[o])
487
+ gen_event = gr.on(triggers=[button_start.click], fn=test_start,inputs=[s], outputs=[s])
488
 
489
  gallery = gr.Gallery(label="Output", show_download_button=True, elem_classes="gallery",
490
  interactive=False, show_share_button=True, container=True, format="png",