Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,7 +83,11 @@ class ChatRequest(BaseModel):
|
|
| 83 |
def is_farewell(message: str) -> bool:
|
| 84 |
farewells = ["bye", "goodbye", "see you", "farewell", "exit", "quit", "end"]
|
| 85 |
message_lower = message.lower().strip()
|
| 86 |
-
return any(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
def clean_input_text(text: str) -> str:
|
| 89 |
# Remove any "Instruction N: ..." or similar phrases
|
|
|
|
| 83 |
def is_farewell(message: str) -> bool:
|
| 84 |
farewells = ["bye", "goodbye", "see you", "farewell", "exit", "quit", "end"]
|
| 85 |
message_lower = message.lower().strip()
|
| 86 |
+
return any(re.search(rf"\b{re.escape(f)}\b", message_lower) for f in farewells)
|
| 87 |
+
# ============================= Recognizes "attend" but with "end" in it... Fix is above ^ =============================
|
| 88 |
+
# farewells = ["bye", "goodbye", "see you", "farewell", "exit", "quit", "end"]
|
| 89 |
+
# message_lower = message.lower().strip()
|
| 90 |
+
# return any(farewell in message_lower for farewell in farewells)
|
| 91 |
|
| 92 |
def clean_input_text(text: str) -> str:
|
| 93 |
# Remove any "Instruction N: ..." or similar phrases
|