Spaces:
Runtime error
Runtime error
Commit
·
9ba085b
1
Parent(s):
138d8b1
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ from langchain.embeddings.openai import OpenAIEmbeddings
|
|
7 |
from langchain.vectorstores import DeepLake
|
8 |
from langchain.chat_models import ChatOpenAI
|
9 |
from langchain.chains import ConversationalRetrievalChain
|
10 |
-
from langchain.llms import OpenAI
|
11 |
|
12 |
def set_api_key(key):
|
13 |
os.environ["OPENAI_API_KEY"] = key
|
@@ -36,7 +35,7 @@ def respond(message, chat_history):
|
|
36 |
|
37 |
# Create ChatOpenAI and ConversationalRetrievalChain
|
38 |
model = ChatOpenAI(model='gpt-3.5-turbo')
|
39 |
-
qa = ConversationalRetrievalChain.from_llm(model, retriever
|
40 |
|
41 |
chat_history=[]
|
42 |
bot_message = qa({"question": message, "chat_history": chat_history})
|
|
|
7 |
from langchain.vectorstores import DeepLake
|
8 |
from langchain.chat_models import ChatOpenAI
|
9 |
from langchain.chains import ConversationalRetrievalChain
|
|
|
10 |
|
11 |
def set_api_key(key):
|
12 |
os.environ["OPENAI_API_KEY"] = key
|
|
|
35 |
|
36 |
# Create ChatOpenAI and ConversationalRetrievalChain
|
37 |
model = ChatOpenAI(model='gpt-3.5-turbo')
|
38 |
+
qa = ConversationalRetrievalChain.from_llm(model, retriever)
|
39 |
|
40 |
chat_history=[]
|
41 |
bot_message = qa({"question": message, "chat_history": chat_history})
|