alexkueck commited on
Commit
691f8b7
1 Parent(s): 2e4f369

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -96,6 +96,10 @@ def document_storage_mongodb(splits):
96
  index_name = MONGODB_INDEX_NAME)
97
 
98
  def document_retrieval_chroma(llm, prompt):
 
 
 
 
99
  db = Chroma(embedding_function = OpenAIEmbeddings(),
100
  persist_directory = CHROMA_DIR)
101
  return db
@@ -132,8 +136,8 @@ def invoke(openai_api_key, rag_option, prompt):
132
  openai_api_key = openai_api_key,
133
  temperature = 0)
134
  if (rag_option == "Chroma"):
135
- #splits = document_loading_splitting()
136
- #document_storage_chroma(splits)
137
  db = document_retrieval_chroma(llm, prompt)
138
  result = rag_chain(llm, prompt, db)
139
  elif (rag_option == "MongoDB"):
 
96
  index_name = MONGODB_INDEX_NAME)
97
 
98
  def document_retrieval_chroma(llm, prompt):
99
+ # Erstelle das Verzeichnis, wenn es nicht existiert
100
+ if not os.path.exists(CHROMA_DIR):
101
+ os.makedirs(CHROMA_DIR)
102
+
103
  db = Chroma(embedding_function = OpenAIEmbeddings(),
104
  persist_directory = CHROMA_DIR)
105
  return db
 
136
  openai_api_key = openai_api_key,
137
  temperature = 0)
138
  if (rag_option == "Chroma"):
139
+ splits = document_loading_splitting()
140
+ document_storage_chroma(splits)
141
  db = document_retrieval_chroma(llm, prompt)
142
  result = rag_chain(llm, prompt, db)
143
  elif (rag_option == "MongoDB"):