Update app.py
Browse files
app.py
CHANGED
|
@@ -88,11 +88,11 @@ def format_prompt(prompt,retrieved_documents,k,history,memory_limit=3):
|
|
| 88 |
PROMPT += f"<s>[INST] {user_message} [/INST] {bot_message} </s>"
|
| 89 |
print("checkwthhist2")
|
| 90 |
|
| 91 |
-
for user_message, bot_message in history[0:]:
|
| 92 |
-
historylog += f"<s>[INST] {user_message} [/INST] {bot_message} </s>"
|
| 93 |
|
| 94 |
-
print(historylog)
|
| 95 |
-
return PROMPT
|
| 96 |
|
| 97 |
|
| 98 |
# Called by talk function to add retrieved documents to the prompt. Keeps adding text of retrieved documents to string that are retreived
|
|
@@ -105,7 +105,7 @@ def talk(prompt, history):
|
|
| 105 |
formatted_prompt = format_prompt(prompt,retrieved_documents,k,history,memory_limit=3) # create a new prompt using the retrieved documents
|
| 106 |
print("check5")
|
| 107 |
pd.options.display.max_colwidth = 4000
|
| 108 |
-
print(historylog)
|
| 109 |
# print(retrieved_documents['0'])
|
| 110 |
# print(formatted_prompt)
|
| 111 |
# formatted_prompt_with_history = add_history(formatted_prompt, history)
|
|
|
|
| 88 |
PROMPT += f"<s>[INST] {user_message} [/INST] {bot_message} </s>"
|
| 89 |
print("checkwthhist2")
|
| 90 |
|
| 91 |
+
# for user_message, bot_message in history[0:]:
|
| 92 |
+
# historylog += f"<s>[INST] {user_message} [/INST] {bot_message} </s>"
|
| 93 |
|
| 94 |
+
# print(historylog)
|
| 95 |
+
return PROMPT
|
| 96 |
|
| 97 |
|
| 98 |
# Called by talk function to add retrieved documents to the prompt. Keeps adding text of retrieved documents to string that are retreived
|
|
|
|
| 105 |
formatted_prompt = format_prompt(prompt,retrieved_documents,k,history,memory_limit=3) # create a new prompt using the retrieved documents
|
| 106 |
print("check5")
|
| 107 |
pd.options.display.max_colwidth = 4000
|
| 108 |
+
# print(historylog)
|
| 109 |
# print(retrieved_documents['0'])
|
| 110 |
# print(formatted_prompt)
|
| 111 |
# formatted_prompt_with_history = add_history(formatted_prompt, history)
|