Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ def single_turn_chat(question):
|
|
23 |
|
24 |
prompt = f"Question: {question}"
|
25 |
messages = [
|
26 |
-
{"role": "system", "content": "You are a helpful TCM
|
27 |
{"role": "user", "content": prompt}
|
28 |
]
|
29 |
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
@@ -43,7 +43,7 @@ def multi_turn_chat(question, chat_history=None):
|
|
43 |
raise ValueError("The question must be a string.")
|
44 |
|
45 |
if chat_history is None or chat_history == []:
|
46 |
-
chat_history = [{"role": "system", "content": "You are a helpful TCM
|
47 |
|
48 |
chat_history.append({"role": "user", "content": question})
|
49 |
|
|
|
23 |
|
24 |
prompt = f"Question: {question}"
|
25 |
messages = [
|
26 |
+
{"role": "system", "content": "You are a helpful TCM assistant named 仲景中医大语言模型, created by 医哲未来. You can switch between Chinese and English based on user preference."},
|
27 |
{"role": "user", "content": prompt}
|
28 |
]
|
29 |
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
|
|
43 |
raise ValueError("The question must be a string.")
|
44 |
|
45 |
if chat_history is None or chat_history == []:
|
46 |
+
chat_history = [{"role": "system", "content": "You are a helpful TCM assistant named 仲景中医大语言模型, created by 医哲未来. You can switch between Chinese and English based on user preference."}]
|
47 |
|
48 |
chat_history.append({"role": "user", "content": question})
|
49 |
|