Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ Reranker_Model_Name = os.getenv("RERANKER_MODEL_NAME")
|
|
| 24 |
K = int(os.getenv("K", "8"))
|
| 25 |
TOP_N = int(os.getenv("TOP_N", "5"))
|
| 26 |
|
| 27 |
-
RPM_LIMIT =
|
| 28 |
MIN_SECONDS_BETWEEN = 30
|
| 29 |
N_DIM = 384
|
| 30 |
|
|
@@ -206,7 +206,7 @@ with gr.Blocks(title=f"{APP_Name} v{APP_Version}", css=CSS) as demo:
|
|
| 206 |
return "", (chat_messages or [])
|
| 207 |
chat_messages = chat_messages or []
|
| 208 |
updated = chat_messages + [{"role": "user", "content": user_input}]
|
| 209 |
-
print("[on_submit] user:", user_input)
|
| 210 |
return "", updated
|
| 211 |
except Exception as e:
|
| 212 |
print("[on_submit][ERROR]", repr(e))
|
|
@@ -227,14 +227,14 @@ with gr.Blocks(title=f"{APP_Name} v{APP_Version}", css=CSS) as demo:
|
|
| 227 |
print("[bot_step] no user message found")
|
| 228 |
return chat_messages, state
|
| 229 |
|
| 230 |
-
print("[bot_step] responding to:", last_user)
|
| 231 |
bot_reply, new_state = respond(last_user, state)
|
| 232 |
|
| 233 |
updated = chat_messages + [{"role": "assistant", "content": bot_reply}]
|
| 234 |
return updated, new_state
|
| 235 |
|
| 236 |
except Exception as e:
|
| 237 |
-
print("[bot_step][ERROR]", repr(e))
|
| 238 |
updated = (chat_messages or []) + [
|
| 239 |
{"role": "assistant", "content": f"⚠️ Internal error: {e}"}
|
| 240 |
]
|
|
|
|
| 24 |
K = int(os.getenv("K", "8"))
|
| 25 |
TOP_N = int(os.getenv("TOP_N", "5"))
|
| 26 |
|
| 27 |
+
RPM_LIMIT = 20
|
| 28 |
MIN_SECONDS_BETWEEN = 30
|
| 29 |
N_DIM = 384
|
| 30 |
|
|
|
|
| 206 |
return "", (chat_messages or [])
|
| 207 |
chat_messages = chat_messages or []
|
| 208 |
updated = chat_messages + [{"role": "user", "content": user_input}]
|
| 209 |
+
# print("[on_submit] user:", user_input)
|
| 210 |
return "", updated
|
| 211 |
except Exception as e:
|
| 212 |
print("[on_submit][ERROR]", repr(e))
|
|
|
|
| 227 |
print("[bot_step] no user message found")
|
| 228 |
return chat_messages, state
|
| 229 |
|
| 230 |
+
# print("[bot_step] responding to:", last_user)
|
| 231 |
bot_reply, new_state = respond(last_user, state)
|
| 232 |
|
| 233 |
updated = chat_messages + [{"role": "assistant", "content": bot_reply}]
|
| 234 |
return updated, new_state
|
| 235 |
|
| 236 |
except Exception as e:
|
| 237 |
+
# print("[bot_step][ERROR]", repr(e))
|
| 238 |
updated = (chat_messages or []) + [
|
| 239 |
{"role": "assistant", "content": f"⚠️ Internal error: {e}"}
|
| 240 |
]
|