Rehman1603 commited on
Commit
10cc401
1 Parent(s): 78a4c42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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'] = "c2f52626b97118b71c0c36f66eda4f5957c8fc475e760c3d72f98ba07d3ed3b5"
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 that the history is a list of two-element lists [query, response]
110
  history.append([query, response['text']])
111
- return response['text'], history
 
 
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: