Spaces:
Sleeping
Sleeping
Update app_strict_lora.py
Browse files- app_strict_lora.py +3 -1
app_strict_lora.py
CHANGED
|
@@ -102,11 +102,13 @@ def chat_with_model(message, history):
|
|
| 102 |
return "", history, "\n".join(LOG_LINES)
|
| 103 |
|
| 104 |
# --- Clean response ---
|
|
|
|
|
|
|
| 105 |
reply = outputs[len(context):].strip()
|
| 106 |
reply = re.sub(r"(<[^>]+>|[\r\n]{3,})", "\n", reply)
|
| 107 |
reply = re.sub(r"\s{2,}", " ", reply).strip()
|
| 108 |
reply = reply.split("User:")[0].split("Assistant:")[0].strip()
|
| 109 |
-
|
| 110 |
# --- Guardrail: only use diffusers context ---
|
| 111 |
if (
|
| 112 |
not reply
|
|
|
|
| 102 |
return "", history, "\n".join(LOG_LINES)
|
| 103 |
|
| 104 |
# --- Clean response ---
|
| 105 |
+
print("output====")
|
| 106 |
+
print(outputs)
|
| 107 |
reply = outputs[len(context):].strip()
|
| 108 |
reply = re.sub(r"(<[^>]+>|[\r\n]{3,})", "\n", reply)
|
| 109 |
reply = re.sub(r"\s{2,}", " ", reply).strip()
|
| 110 |
reply = reply.split("User:")[0].split("Assistant:")[0].strip()
|
| 111 |
+
print(reply)
|
| 112 |
# --- Guardrail: only use diffusers context ---
|
| 113 |
if (
|
| 114 |
not reply
|