YoBatM commited on
Commit
00973d9
·
verified ·
1 Parent(s): 2c87261

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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","ops":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(len(l.get("ops"))):
70
  resp.append(gr.Button(value=l.get("ops")[c],visible=True))
71
- for o in range(4-len(l.get("ops"))):
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(len(l.get("ops"))):
95
  resp.append(gr.Button(value=l.get("ops")[c],visible=True))
96
- for o in range(4-len(l.get("ops"))):
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: