Spaces:
Running
Running
Update scripts/chat_web.py
Browse files- scripts/chat_web.py +5 -5
scripts/chat_web.py
CHANGED
|
@@ -51,10 +51,10 @@ from nanochat.checkpoint_manager import load_model
|
|
| 51 |
from nanochat.engine import Engine
|
| 52 |
|
| 53 |
# Victorian system prompt — prepended to first user turn during inference
|
| 54 |
-
SYSTEM_PREFIX = (
|
| 55 |
-
"[You are a learned Victorian gentleman in conversation. "
|
| 56 |
-
"Address the question or remark put to you directly.]\n\n"
|
| 57 |
-
)
|
| 58 |
|
| 59 |
# Abuse prevention limits
|
| 60 |
MAX_MESSAGES_PER_REQUEST = 500
|
|
@@ -399,7 +399,7 @@ async def chat_completions(request: ChatRequest):
|
|
| 399 |
content = content[0].upper() + content[1:]
|
| 400 |
# Prepend system prompt to the first user turn
|
| 401 |
if turn_count == 0:
|
| 402 |
-
content =
|
| 403 |
conversation_tokens.append(user_start)
|
| 404 |
conversation_tokens.extend(worker.tokenizer.encode(content))
|
| 405 |
conversation_tokens.append(user_end)
|
|
|
|
| 51 |
from nanochat.engine import Engine
|
| 52 |
|
| 53 |
# Victorian system prompt — prepended to first user turn during inference
|
| 54 |
+
# SYSTEM_PREFIX = (
|
| 55 |
+
# "[You are a learned Victorian gentleman in conversation. "
|
| 56 |
+
# "Address the question or remark put to you directly.]\n\n"
|
| 57 |
+
# )
|
| 58 |
|
| 59 |
# Abuse prevention limits
|
| 60 |
MAX_MESSAGES_PER_REQUEST = 500
|
|
|
|
| 399 |
content = content[0].upper() + content[1:]
|
| 400 |
# Prepend system prompt to the first user turn
|
| 401 |
if turn_count == 0:
|
| 402 |
+
content = content
|
| 403 |
conversation_tokens.append(user_start)
|
| 404 |
conversation_tokens.extend(worker.tokenizer.encode(content))
|
| 405 |
conversation_tokens.append(user_end)
|