vilarin commited on
Commit
d16121f
·
verified ·
1 Parent(s): 30639e2

Update app/webui/app.py

Browse files
Files changed (1) hide show
  1. app/webui/app.py +8 -0
app/webui/app.py CHANGED
@@ -123,6 +123,12 @@ def closeBtnHide(output_final):
123
  if output_final:
124
  return gr.update(visible=True), gr.update(visible=False)
125
 
 
 
 
 
 
 
126
  TITLE = """
127
  <div style="display: inline-flex;">
128
  <div style="margin-left: 6px; font-size:32px; color: #6366f1"><b>Translation Agent</b> WebUI</div>
@@ -284,6 +290,8 @@ with gr.Blocks(theme="soft", css=CSS, fill_height=True) as demo:
284
 
285
  menuBtn.click(fn=update_menu, inputs=visible, outputs=[visible, menubar], js=JS)
286
  endpoint.change(fn=update_model, inputs=[endpoint], outputs=[model])
 
 
287
 
288
  choice.select(fn=enable_sec, inputs=[choice], outputs=[AddEndpoint])
289
  endpoint2.change(fn=update_model, inputs=[endpoint2], outputs=[model2])
 
123
  if output_final:
124
  return gr.update(visible=True), gr.update(visible=False)
125
 
126
+ def hide_add(gt):
127
+ if gt:
128
+ return gr.update(visible=False), gr.update(visible=False)
129
+ else:
130
+ return gr.update(visible=True), gr.update(visible=True)
131
+
132
  TITLE = """
133
  <div style="display: inline-flex;">
134
  <div style="margin-left: 6px; font-size:32px; color: #6366f1"><b>Translation Agent</b> WebUI</div>
 
290
 
291
  menuBtn.click(fn=update_menu, inputs=visible, outputs=[visible, menubar], js=JS)
292
  endpoint.change(fn=update_model, inputs=[endpoint], outputs=[model])
293
+
294
+ gt.select(fn=hide_add, inputs=gt, outputs=[choice, AddEndpoint])
295
 
296
  choice.select(fn=enable_sec, inputs=[choice], outputs=[AddEndpoint])
297
  endpoint2.change(fn=update_model, inputs=[endpoint2], outputs=[model2])