Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ from langchain import LLMChain
|
|
| 11 |
from langchain_together import Together
|
| 12 |
import os
|
| 13 |
|
| 14 |
-
os.environ['TOGETHER_API_KEY'] = "
|
| 15 |
|
| 16 |
# Initialize global variable for vectorstore
|
| 17 |
vectorstore = None
|
|
@@ -106,9 +106,11 @@ Question: {query}
|
|
| 106 |
Generated_chat = LLMChain(llm=llama3, prompt=prompt)
|
| 107 |
response = Generated_chat.invoke({'retrieved_documents': retrieved_documents, 'query': query})
|
| 108 |
|
| 109 |
-
# Ensure
|
| 110 |
history.append([query, response['text']])
|
| 111 |
-
|
|
|
|
|
|
|
| 112 |
|
| 113 |
def gradio_app():
|
| 114 |
with gr.Blocks() as app:
|
|
|
|
| 11 |
from langchain_together import Together
|
| 12 |
import os
|
| 13 |
|
| 14 |
+
os.environ['TOGETHER_API_KEY'] = "your_api_key"
|
| 15 |
|
| 16 |
# Initialize global variable for vectorstore
|
| 17 |
vectorstore = None
|
|
|
|
| 106 |
Generated_chat = LLMChain(llm=llama3, prompt=prompt)
|
| 107 |
response = Generated_chat.invoke({'retrieved_documents': retrieved_documents, 'query': query})
|
| 108 |
|
| 109 |
+
# Ensure history is always a list of two-element lists [query, response]
|
| 110 |
history.append([query, response['text']])
|
| 111 |
+
|
| 112 |
+
# Return the updated history and the new response for display
|
| 113 |
+
return history, history
|
| 114 |
|
| 115 |
def gradio_app():
|
| 116 |
with gr.Blocks() as app:
|