Spaces:
Sleeping
Sleeping
Update app.py
Browse filesHide person and text changes
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(
|
23 |
|
24 |
def show_fn():
|
25 |
-
return gr.Textbox.update(
|
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
|
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
|
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(
|
115 |
-
show_button.click(
|
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()
|