mcuri commited on
Commit
a627b01
1 Parent(s): 2ae53dc

Update app.py

Browse files

Hide person and text changes

Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -19,10 +19,10 @@ def clear_chat(message, chat_history):
19
  return "", []
20
 
21
  def hide_fn():
22
- return gr.Textbox.update(visible=False)
23
 
24
  def show_fn():
25
- return gr.Textbox.update(visible=True)
26
 
27
  def add_new_message(message,person, chat_history):
28
  new_chat = []
@@ -85,13 +85,13 @@ with gr.Blocks() as demo:
85
  </h1>
86
  <img src='data:image/jpg;base64,{}' width=200px>
87
  <h3>
88
- Con este espacio podr谩s hablar en formato conversaci贸n con el personaje famoso que quieras, puede ser Albert Einstein, Marie Curie o el/la que quieras!
89
  </h3>
90
  </center>
91
  """.format(encoded_image))
92
  with gr.Row():
93
  with gr.Column(scale=4):
94
- person = gr.Textbox(label="Escrib铆 el nombre del perosnaje famoso:",visible=True)
95
  with gr.Column(scale=1):
96
  hide_button = gr.Button(value="No mostrar")
97
  show_button = gr.Button(value="Mostrar")
@@ -111,8 +111,8 @@ with gr.Blocks() as demo:
111
  btn.click(respond, inputs=[msg,person, chatbot], outputs=[msg, chatbot])
112
  msg.submit(respond, inputs=[msg, person,chatbot], outputs=[msg, chatbot]) #Press enter to submit
113
  clear.click(clear_chat,inputs=[msg, chatbot], outputs=[msg, chatbot])
114
- hide_button.click(fn=hide_fn,outputs=[person])
115
- show_button.click(fn=show_fn,outputs=[person])
116
 
117
  demo.queue()
118
  demo.launch()
 
19
  return "", []
20
 
21
  def hide_fn():
22
+ return gr.Textbox.update(type="password")
23
 
24
  def show_fn():
25
+ return gr.Textbox.update(type="text")
26
 
27
  def add_new_message(message,person, chat_history):
28
  new_chat = []
 
85
  </h1>
86
  <img src='data:image/jpg;base64,{}' width=200px>
87
  <h3>
88
+ Con este espacio podr谩s hablar en formato conversaci贸n con el personaje famoso que quieras, puede ser Albert Einstein, Marie Curie o quien quieras.
89
  </h3>
90
  </center>
91
  """.format(encoded_image))
92
  with gr.Row():
93
  with gr.Column(scale=4):
94
+ person = gr.Textbox(label="Escrib铆 el nombre del personaje famoso:",type="text")
95
  with gr.Column(scale=1):
96
  hide_button = gr.Button(value="No mostrar")
97
  show_button = gr.Button(value="Mostrar")
 
111
  btn.click(respond, inputs=[msg,person, chatbot], outputs=[msg, chatbot])
112
  msg.submit(respond, inputs=[msg, person,chatbot], outputs=[msg, chatbot]) #Press enter to submit
113
  clear.click(clear_chat,inputs=[msg, chatbot], outputs=[msg, chatbot])
114
+ hide_button.click(hide_fn,outputs=[person])
115
+ show_button.click(show_fn,outputs=[person])
116
 
117
  demo.queue()
118
  demo.launch()