Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,13 +34,13 @@ def generate_and_parse(messages: list, temperature: float = 0.6,
|
|
| 34 |
and parses it into thinking and answer parts.
|
| 35 |
Decorated with @spaces.GPU for Zero GPU allocation.
|
| 36 |
"""
|
| 37 |
-
#
|
| 38 |
-
prompt_text =
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
# --- CONSOLE DEBUG OUTPUT ---
|
| 46 |
print("\n" + "="*50)
|
|
|
|
| 34 |
and parses it into thinking and answer parts.
|
| 35 |
Decorated with @spaces.GPU for Zero GPU allocation.
|
| 36 |
"""
|
| 37 |
+
# Build prompt manually to preserve <think> tags in context
|
| 38 |
+
prompt_text = ""
|
| 39 |
+
for msg in messages:
|
| 40 |
+
role = msg["role"]
|
| 41 |
+
content = msg["content"]
|
| 42 |
+
prompt_text += f"<|im_start|>{role}\n{content}<|im_end|>\n"
|
| 43 |
+
prompt_text += "<|im_start|>assistant\n"
|
| 44 |
|
| 45 |
# --- CONSOLE DEBUG OUTPUT ---
|
| 46 |
print("\n" + "="*50)
|