Spaces:
Runtime error
Runtime error
Oleg Lavrovsky
commited on
System prompt
Browse files
app.py
CHANGED
|
@@ -142,12 +142,10 @@ def get_model_reponse(messages_think: List[ChatMessage]):
|
|
| 142 |
if m.role == 'system':
|
| 143 |
has_system = True
|
| 144 |
if not has_system:
|
| 145 |
-
|
| 146 |
-
sp = sp.replace('{date}', str(datetime.now().date()))
|
| 147 |
-
sp = sp.replace('{time}', str(datetime.now().time()))
|
| 148 |
-
cm = ChatMessage(role = 'system', content = sp)
|
| 149 |
messages_think.insert(0, cm)
|
| 150 |
#print(messages_think)
|
|
|
|
| 151 |
# Prepare the model input
|
| 152 |
text = tokenizer.apply_chat_template(
|
| 153 |
messages_think,
|
|
|
|
| 142 |
if m.role == 'system':
|
| 143 |
has_system = True
|
| 144 |
if not has_system:
|
| 145 |
+
cm = ChatMessage(role='system', content=system_prompt)
|
|
|
|
|
|
|
|
|
|
| 146 |
messages_think.insert(0, cm)
|
| 147 |
#print(messages_think)
|
| 148 |
+
|
| 149 |
# Prepare the model input
|
| 150 |
text = tokenizer.apply_chat_template(
|
| 151 |
messages_think,
|