Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,8 @@ def load_pdf_and_generate_embeddings(pdf_doc, open_ai_key, relevant_pages='all')
|
|
21 |
#Create an instance of OpenAIEmbeddings, which is responsible for generating embeddings for text
|
22 |
embeddings = OpenAIEmbeddings()
|
23 |
|
|
|
|
|
24 |
if relevant_pages == 'all':
|
25 |
#To create a vector store, we use the Chroma class, which takes the documents (pages in our case) and the embeddings instance
|
26 |
vectordb = Chroma.from_documents(pages, embedding=embeddings)
|
|
|
21 |
#Create an instance of OpenAIEmbeddings, which is responsible for generating embeddings for text
|
22 |
embeddings = OpenAIEmbeddings()
|
23 |
|
24 |
+
global vectordb
|
25 |
+
|
26 |
if relevant_pages == 'all':
|
27 |
#To create a vector store, we use the Chroma class, which takes the documents (pages in our case) and the embeddings instance
|
28 |
vectordb = Chroma.from_documents(pages, embedding=embeddings)
|