FredZhang7
commited on
Commit
•
8f494a0
1
Parent(s):
3dc48ef
fix conv history
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ def generate_prompt(instruction, input=None, history=None):
|
|
23 |
if (history is not None) and len(history) > 1:
|
24 |
input = "\""
|
25 |
for pair in history:
|
26 |
-
if pair[0] is not None and pair[1] is not None:
|
27 |
input += f"User: {pair[0]}\nAssistant: {pair[1]}\n"
|
28 |
input = input[:-1] + "\"\n" + f"User: {instruction}"
|
29 |
instruction = "Based on the Conversation History, generate a Response for the User."
|
|
|
23 |
if (history is not None) and len(history) > 1:
|
24 |
input = "\""
|
25 |
for pair in history:
|
26 |
+
if pair[0] is not None and pair[1] is not None and len(pair[1]) > 0:
|
27 |
input += f"User: {pair[0]}\nAssistant: {pair[1]}\n"
|
28 |
input = input[:-1] + "\"\n" + f"User: {instruction}"
|
29 |
instruction = "Based on the Conversation History, generate a Response for the User."
|