Spaces:
Sleeping
Sleeping
Sébastien De Greef
commited on
Commit
·
40802c2
1
Parent(s):
e7a2ae9
Fix typo in main.py
Browse files
main.py
CHANGED
@@ -11,11 +11,11 @@ def predict(message, history):
|
|
11 |
history_langchain_format.append(AIMessage(content=ai))
|
12 |
history_langchain_format.append(HumanMessage(content=message))
|
13 |
try:
|
14 |
-
|
15 |
-
except
|
16 |
-
|
17 |
|
18 |
-
return
|
19 |
|
20 |
def run():
|
21 |
demo = gr.ChatInterface(predict)
|
|
|
11 |
history_langchain_format.append(AIMessage(content=ai))
|
12 |
history_langchain_format.append(HumanMessage(content=message))
|
13 |
try:
|
14 |
+
chat_response = llm.invoke(history_langchain_format)
|
15 |
+
except chat_response as e:
|
16 |
+
chat_response = "Error: " + str(e)
|
17 |
|
18 |
+
return chat_response
|
19 |
|
20 |
def run():
|
21 |
demo = gr.ChatInterface(predict)
|