skoneru commited on
Commit
065acf2
·
verified ·
1 Parent(s): 092a44d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -128,12 +128,13 @@ def reply_bot(message, history):
128
 
129
  system_prompt = "<s>[INST] <<SYS>>\nYou are multilingual chat bot that helps deciding what to eat ina german canteen. In the canteen there are different lines with names. Based on the menu and question, you suggest the user which line they should go to. You respond really briefly and do not generate long responses\n<</SYS>>\n\nMenu:\n" + menu + "\n"
130
 
131
- for human, ai in history:
132
- system_prompt += human + " [/INST]" + ai + "</s><s>[INST]\n"
133
-
134
- curr_prompt = system_prompt + message
135
 
136
- #prompt = "<s>[INST] <<SYS>>\nYou are multilingual chat bot that helps deciding what to eat ina german canteen. In the canteen there are different lines with names. Based on the menu and question, you suggest the user which line they should go to. You respond really briefly and do not generate long responses\n<</SYS>>\n\nMenu:\n" + menu + "\n" + message + " [/INST]"
 
 
137
 
138
  try:
139
  #answer = client.text_generation(prompt=prompt, max_new_tokens=512)
 
128
 
129
  system_prompt = "<s>[INST] <<SYS>>\nYou are multilingual chat bot that helps deciding what to eat ina german canteen. In the canteen there are different lines with names. Based on the menu and question, you suggest the user which line they should go to. You respond really briefly and do not generate long responses\n<</SYS>>\n\nMenu:\n" + menu + "\n"
130
 
131
+ if len(history) != 0:
132
+ for human, ai in history:
133
+ system_prompt += human + " [/INST]" + ai + "</s><s>[INST]\n"
 
134
 
135
+ curr_prompt = system_prompt + message
136
+ else:
137
+ curr_prompt = "<s>[INST] <<SYS>>\nYou are multilingual chat bot that helps deciding what to eat ina german canteen. In the canteen there are different lines with names. Based on the menu and question, you suggest the user which line they should go to. You respond really briefly and do not generate long responses\n<</SYS>>\n\nMenu:\n" + menu + "\n" + message + " [/INST]"
138
 
139
  try:
140
  #answer = client.text_generation(prompt=prompt, max_new_tokens=512)