WeyinmiA commited on
Commit
3708eb7
Β·
1 Parent(s): bf2a15e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -62,7 +62,14 @@ def augment_llm_with_docs(files):
62
 
63
  persist_directory_openai = 'docs/chroma/openai/'
64
  #!rm -rf ./docs/chroma/openai
65
- shutil.rmtree(persist_directory_openai)
 
 
 
 
 
 
 
66
  openai_embeddings = OpenAIEmbeddings()
67
 
68
  # Finally we make our Index (i.e. Vector Database) using chromadb and the open ai embeddings LLM
 
62
 
63
  persist_directory_openai = 'docs/chroma/openai/'
64
  #!rm -rf ./docs/chroma/openai
65
+
66
+ try:
67
+ shutil.rmtree(persist_directory_openai)
68
+ print("Directory removed successfully")
69
+ except FileNotFoundError:
70
+ print("/docs/chroma/openai directory does not exist")
71
+ continue
72
+
73
  openai_embeddings = OpenAIEmbeddings()
74
 
75
  # Finally we make our Index (i.e. Vector Database) using chromadb and the open ai embeddings LLM