Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -66,6 +66,15 @@ async def chat_stream(idx, local_data, instruction_txtbox, chat_state):
|
|
| 66 |
ppm.append_pong(result)
|
| 67 |
yield ppm.build_uis(), str(res)
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
def set_chatbot(btn, ld, state):
|
| 70 |
choice = channel_num(btn)
|
| 71 |
|
|
|
|
| 66 |
ppm.append_pong(result)
|
| 67 |
yield ppm.build_uis(), str(res)
|
| 68 |
|
| 69 |
+
def channel_num(btn_title):
|
| 70 |
+
choice = 0
|
| 71 |
+
|
| 72 |
+
for idx, channel in enumerate(channels):
|
| 73 |
+
if channel == btn_title:
|
| 74 |
+
choice = idx
|
| 75 |
+
|
| 76 |
+
return choice
|
| 77 |
+
|
| 78 |
def set_chatbot(btn, ld, state):
|
| 79 |
choice = channel_num(btn)
|
| 80 |
|