Spaces:
Paused
Paused
Updated system prompt
Browse files
app.py
CHANGED
|
@@ -9,7 +9,8 @@ tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
| 9 |
|
| 10 |
def chat(message, history):
|
| 11 |
# 1. Format the conversation using the official template
|
| 12 |
-
messages = [{"role": "user", "content": message}
|
|
|
|
| 13 |
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 14 |
|
| 15 |
# 2. Generate with a 'stop' token
|
|
|
|
| 9 |
|
| 10 |
def chat(message, history):
|
| 11 |
# 1. Format the conversation using the official template
|
| 12 |
+
messages = [{"role": "user", "content": message},
|
| 13 |
+
{"role": "system", "content": "Use context if relevant, otherwise answer generally."},]
|
| 14 |
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 15 |
|
| 16 |
# 2. Generate with a 'stop' token
|