FredZhang7
commited on
Commit
•
e4251f1
1
Parent(s):
7faf5ad
Update app.py
Browse files
app.py
CHANGED
@@ -16,8 +16,10 @@ pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
|
16 |
def generate_prompt(instruction, input=None, history=None):
|
17 |
# parse the chat history into a string of user and assistant messages
|
18 |
history_str = ""
|
19 |
-
|
20 |
-
|
|
|
|
|
21 |
|
22 |
instruction = instruction.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
23 |
input = input.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
|
|
16 |
def generate_prompt(instruction, input=None, history=None):
|
17 |
# parse the chat history into a string of user and assistant messages
|
18 |
history_str = ""
|
19 |
+
|
20 |
+
if history is not None:
|
21 |
+
for pair in history:
|
22 |
+
history_str += f"Instruction: {pair[0]}\n\nAssistant: {pair[1]}\n\n"
|
23 |
|
24 |
instruction = instruction.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
25 |
input = input.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|