Yaron Koresh commited on
Commit
7dd59c4
verified
1 Parent(s): d167970

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -149,8 +149,8 @@ if torch.cuda.is_available():
149
  else:
150
  power_device = "诪注讘讚 诇讜讙讬"
151
 
152
- result = []
153
  with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
 
154
  with gr.Column(elem_id="col-container"):
155
  gr.Markdown(f"""
156
  # 诪讞讜诇诇 转诪讜谞讜转 - {power_device}
@@ -191,8 +191,13 @@ with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
191
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
192
 
193
  def _ret(idx):
194
- v = infer(prompt,prompt2)
195
- gr.update(result[idx],value=v)
 
 
 
 
 
196
  def _rets():
197
  ln = len(result)
198
  idxs = list(range(ln))
 
149
  else:
150
  power_device = "诪注讘讚 诇讜讙讬"
151
 
 
152
  with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
153
+ result = []
154
  with gr.Column(elem_id="col-container"):
155
  gr.Markdown(f"""
156
  # 诪讞讜诇诇 转诪讜谞讜转 - {power_device}
 
191
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
192
 
193
  def _ret(idx):
194
+ el = result[idx]
195
+ p1 = prompt.value
196
+ p2 = prompt2.value
197
+ print(f'Starting {idx}: {el} {p1} {p2}')
198
+ v = infer(p1,p2)
199
+ print(f'Finished {idx}: {v}')
200
+ el.value=v
201
  def _rets():
202
  ln = len(result)
203
  idxs = list(range(ln))