alexkueck commited on
Commit
9bd3f5e
1 Parent(s): 7bf0758

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -52,6 +52,7 @@ LLM_CHAIN_PROMPT = PromptTemplate(input_variables = ["question"],
52
  RAG_CHAIN_PROMPT = PromptTemplate(input_variables = ["context", "question"],
53
  template = rag_template)
54
 
 
55
  CHROMA_DIR = "/data/chroma"
56
  YOUTUBE_DIR = "/data/youtube"
57
 
@@ -95,11 +96,7 @@ def document_storage_mongodb(splits):
95
  collection = MONGODB_COLLECTION,
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
 
52
  RAG_CHAIN_PROMPT = PromptTemplate(input_variables = ["context", "question"],
53
  template = rag_template)
54
 
55
+ #Pfad, wo Docs abgelegt werden können - lokal, also hier im HF Space (sonst auf eigenem Rechner)
56
  CHROMA_DIR = "/data/chroma"
57
  YOUTUBE_DIR = "/data/youtube"
58
 
 
96
  collection = MONGODB_COLLECTION,
97
  index_name = MONGODB_INDEX_NAME)
98
 
99
+ def document_retrieval_chroma(llm, prompt):
 
 
 
 
100
  db = Chroma(embedding_function = OpenAIEmbeddings(),
101
  persist_directory = CHROMA_DIR)
102
  return db