Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,12 +60,12 @@ def load_pdf(file_path):
|
|
60 |
with open(f"{store_name}.pkl", "rb") as f:
|
61 |
VectorStore = pickle.load(f)
|
62 |
else:
|
63 |
-
embeddings = OpenAIEmbeddings()
|
64 |
VectorStore = FAISS.from_texts(chunks, embedding=embeddings)
|
65 |
with open(f"{store_name}.pkl", "wb") as f:
|
66 |
pickle.dump(VectorStore, f)
|
67 |
|
68 |
-
return VectorStore
|
69 |
|
70 |
def load_chatbot():
|
71 |
return load_qa_chain(llm=OpenAI(), chain_type="stuff")
|
|
|
60 |
with open(f"{store_name}.pkl", "rb") as f:
|
61 |
VectorStore = pickle.load(f)
|
62 |
else:
|
63 |
+
embeddings = OpenAIEmbeddings(api_key=os.environ['OPENAI_API_KEY'])
|
64 |
VectorStore = FAISS.from_texts(chunks, embedding=embeddings)
|
65 |
with open(f"{store_name}.pkl", "wb") as f:
|
66 |
pickle.dump(VectorStore, f)
|
67 |
|
68 |
+
return VectorStore
|
69 |
|
70 |
def load_chatbot():
|
71 |
return load_qa_chain(llm=OpenAI(), chain_type="stuff")
|