Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -128,7 +128,7 @@ def embed_pdf(file, collection_name):
|
|
| 128 |
file_content = file.read()
|
| 129 |
else:
|
| 130 |
# Handle the case where 'read' method is not available
|
| 131 |
-
file_content = file
|
| 132 |
|
| 133 |
with open(file_path, 'wb') as f:
|
| 134 |
f.write(file_content)
|
|
@@ -150,7 +150,7 @@ def embed_pdf(file, collection_name):
|
|
| 150 |
|
| 151 |
os.remove(file_path)
|
| 152 |
return {"message": f"Documents embedded in Weaviate collection '{collection_name}'"}
|
| 153 |
-
|
| 154 |
def retrieve_info(query):
|
| 155 |
llm = OpenAI(temperature=0, openai_api_key=openai_api_key)
|
| 156 |
qa = RetrievalQA.from_chain_type(llm, retriever=vectorstore.as_retriever())
|
|
|
|
| 128 |
file_content = file.read()
|
| 129 |
else:
|
| 130 |
# Handle the case where 'read' method is not available
|
| 131 |
+
file_content = file
|
| 132 |
|
| 133 |
with open(file_path, 'wb') as f:
|
| 134 |
f.write(file_content)
|
|
|
|
| 150 |
|
| 151 |
os.remove(file_path)
|
| 152 |
return {"message": f"Documents embedded in Weaviate collection '{collection_name}'"}
|
| 153 |
+
|
| 154 |
def retrieve_info(query):
|
| 155 |
llm = OpenAI(temperature=0, openai_api_key=openai_api_key)
|
| 156 |
qa = RetrievalQA.from_chain_type(llm, retriever=vectorstore.as_retriever())
|