lekkalar commited on
Commit
aed0db9
·
1 Parent(s): 3267b14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -40,8 +40,13 @@ def load_pdf_and_generate_embeddings(pdf_doc, open_ai_key, relevant_pages):
40
 
41
 
42
  #To create a vector store, we use the Chroma class, which takes the documents (pages in our case) and the embeddings instance
43
- vectordb = Chroma.from_documents(documents=pages_to_be_loaded, embedding=embeddings, persist_directory='db')
44
- print("Vectordb has been created")
 
 
 
 
 
45
 
46
  #Finally, we create the bot using the RetrievalQA class
47
  global pdf_qa
 
40
 
41
 
42
  #To create a vector store, we use the Chroma class, which takes the documents (pages in our case) and the embeddings instance
43
+ try:
44
+ vectordb = Chroma.from_documents(documents=pages_to_be_loaded, embedding=embeddings, persist_directory='db')
45
+ print("Vectordb has been created")
46
+ except:
47
+ traceback.print_exc()
48
+ #vectordb = Chroma.from_documents(documents=pages_to_be_loaded, embedding=embeddings, persist_directory='db')
49
+ #print("Vectordb has been created")
50
 
51
  #Finally, we create the bot using the RetrievalQA class
52
  global pdf_qa