Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 7 |
# -------------------------------------------------
|
| 8 |
# Model setup (loaded once at startup)
|
| 9 |
# -------------------------------------------------
|
| 10 |
-
model_name = "CustomThinker-0-8B"
|
| 11 |
|
| 12 |
# Load model and tokenizer globally
|
| 13 |
print("Loading model and tokenizer...")
|
|
@@ -289,8 +289,11 @@ Think using bullet points and short sentences to simulate thoughts and emoticons
|
|
| 289 |
max_new_tokens=max_tokens
|
| 290 |
)
|
| 291 |
|
| 292 |
-
# Update model history with
|
| 293 |
-
|
|
|
|
|
|
|
|
|
|
| 294 |
|
| 295 |
# Format response for display (with HTML formatting)
|
| 296 |
if thinking and thinking.strip():
|
|
|
|
| 7 |
# -------------------------------------------------
|
| 8 |
# Model setup (loaded once at startup)
|
| 9 |
# -------------------------------------------------
|
| 10 |
+
model_name = "gr0010/CustomThinker-0-8B"
|
| 11 |
|
| 12 |
# Load model and tokenizer globally
|
| 13 |
print("Loading model and tokenizer...")
|
|
|
|
| 289 |
max_new_tokens=max_tokens
|
| 290 |
)
|
| 291 |
|
| 292 |
+
# Update model history with thinking AND answer (CHANGED)
|
| 293 |
+
if thinking and thinking.strip():
|
| 294 |
+
model_history.append({"role": "assistant", "content": f"<think>{thinking}</think>\n{answer}"})
|
| 295 |
+
else:
|
| 296 |
+
model_history.append({"role": "assistant", "content": answer})
|
| 297 |
|
| 298 |
# Format response for display (with HTML formatting)
|
| 299 |
if thinking and thinking.strip():
|