Spaces:
Runtime error
Runtime error
MarcoAland
commited on
Commit
•
8440a15
1
Parent(s):
acebcde
Update app.py
Browse files
app.py
CHANGED
@@ -86,14 +86,11 @@ async def start_chat():
|
|
86 |
async def main(message: cl.Message):
|
87 |
if "document:" in message.content.lower() or "documents:" in message.content.lower():
|
88 |
# Prepare the message with documents context
|
89 |
-
prompt = RAG_Trwira.main(message.content[10:]) #slice the "documents" command
|
90 |
else:
|
91 |
# Without documents context
|
92 |
prompt = message.content
|
93 |
|
94 |
-
# Sanity check
|
95 |
-
# print(prompt)
|
96 |
-
|
97 |
# Format the messages as a list of message dictionaries
|
98 |
message_formated = [
|
99 |
{"role": "user", "content": prompt}
|
@@ -111,4 +108,4 @@ async def main(message: cl.Message):
|
|
111 |
await msg.stream_token(token)
|
112 |
|
113 |
# Update the message after streaming completion
|
114 |
-
await msg.update()
|
|
|
86 |
async def main(message: cl.Message):
|
87 |
if "document:" in message.content.lower() or "documents:" in message.content.lower():
|
88 |
# Prepare the message with documents context
|
89 |
+
prompt = RAG_Trwira.main(message.content[10:]) # slice the "documents" command
|
90 |
else:
|
91 |
# Without documents context
|
92 |
prompt = message.content
|
93 |
|
|
|
|
|
|
|
94 |
# Format the messages as a list of message dictionaries
|
95 |
message_formated = [
|
96 |
{"role": "user", "content": prompt}
|
|
|
108 |
await msg.stream_token(token)
|
109 |
|
110 |
# Update the message after streaming completion
|
111 |
+
await msg.update()
|