Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,13 +62,13 @@ def reply(msg,history):
|
|
62 |
try:
|
63 |
l=loads(p)
|
64 |
except Exception as e:
|
65 |
-
l={"msg":"Ocurrio un error","
|
66 |
print(p,"->")
|
67 |
historias.pop(0)
|
68 |
resp=[gr.Textbox(value=l.get("msg")),gr.Chatbot(value=llamatochat(historias),visible=False)]
|
69 |
-
for c in range(
|
70 |
resp.append(gr.Button(value=l.get("ops")[c],visible=True))
|
71 |
-
for o in range(4-
|
72 |
resp.append(gr.Button(value="",visible=False))
|
73 |
return resp
|
74 |
def set_theme(theme):
|
@@ -91,9 +91,9 @@ def set_theme(theme):
|
|
91 |
|
92 |
cc=gr.Chatbot(value=llamatochat(historias), visible=False)
|
93 |
resp=[gr.Textbox(visible=False),gr.Button(visible=False),gr.Textbox(visible=True,value=l.get("msg")),cc]
|
94 |
-
for c in range(
|
95 |
resp.append(gr.Button(value=l.get("ops")[c],visible=True))
|
96 |
-
for o in range(4-
|
97 |
resp.append(gr.Button(value="",visible=False))
|
98 |
return resp
|
99 |
with gr.Blocks(css=css) as ia:
|
|
|
62 |
try:
|
63 |
l=loads(p)
|
64 |
except Exception as e:
|
65 |
+
l={"msg":"Ocurrio un error","options":0}
|
66 |
print(p,"->")
|
67 |
historias.pop(0)
|
68 |
resp=[gr.Textbox(value=l.get("msg")),gr.Chatbot(value=llamatochat(historias),visible=False)]
|
69 |
+
for c in range(l.get("options")):
|
70 |
resp.append(gr.Button(value=l.get("ops")[c],visible=True))
|
71 |
+
for o in range(4-l.get("options")):
|
72 |
resp.append(gr.Button(value="",visible=False))
|
73 |
return resp
|
74 |
def set_theme(theme):
|
|
|
91 |
|
92 |
cc=gr.Chatbot(value=llamatochat(historias), visible=False)
|
93 |
resp=[gr.Textbox(visible=False),gr.Button(visible=False),gr.Textbox(visible=True,value=l.get("msg")),cc]
|
94 |
+
for c in range(l.get("options")):
|
95 |
resp.append(gr.Button(value=l.get("ops")[c],visible=True))
|
96 |
+
for o in range(4-l.get("options")):
|
97 |
resp.append(gr.Button(value="",visible=False))
|
98 |
return resp
|
99 |
with gr.Blocks(css=css) as ia:
|