Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -45,8 +45,8 @@ def has_no_history(chatbot, history):
|
|
45 |
return not chatbot and not history
|
46 |
|
47 |
|
48 |
-
header = "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
|
49 |
-
prompt_template = "### Human: {query} ### Assistant:{response}"
|
50 |
|
51 |
def generate(
|
52 |
user_message,
|
@@ -78,7 +78,7 @@ def generate(
|
|
78 |
for i in range(0, len(past_messages), 2):
|
79 |
intermediate_prompt = prompt_template.format(query=past_messages[i]["content"], response=past_messages[i+1]["content"])
|
80 |
print("intermediate: ", intermediate_prompt)
|
81 |
-
prompt = prompt + intermediate_prompt
|
82 |
|
83 |
prompt = prompt + prompt_template.format(query=user_message, response="")
|
84 |
|
|
|
45 |
return not chatbot and not history
|
46 |
|
47 |
|
48 |
+
header = "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions."
|
49 |
+
prompt_template = "### Human: {query}\n ### Assistant:{response}"
|
50 |
|
51 |
def generate(
|
52 |
user_message,
|
|
|
78 |
for i in range(0, len(past_messages), 2):
|
79 |
intermediate_prompt = prompt_template.format(query=past_messages[i]["content"], response=past_messages[i+1]["content"])
|
80 |
print("intermediate: ", intermediate_prompt)
|
81 |
+
prompt = prompt + '\n' + intermediate_prompt
|
82 |
|
83 |
prompt = prompt + prompt_template.format(query=user_message, response="")
|
84 |
|