inoid commited on
Commit
2d1e5c5
·
1 Parent(s): 19a648e

Updare retrive creation

Browse files
Files changed (1) hide show
  1. seminar_edition_ai.py +13 -0
seminar_edition_ai.py CHANGED
@@ -278,6 +278,19 @@ def predictArgumentQuestionBuild(questionAnswer, llmModelList = []):
278
  )
279
  global retriever
280
  global HISTORY_ANSWER
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  answer = askQuestionEx(
282
  "",
283
  chain,
 
278
  )
279
  global retriever
280
  global HISTORY_ANSWER
281
+
282
+ if retriever == None:
283
+ doc = Document(page_content="text", metadata={"source": "local"})
284
+
285
+ vectorstore = Chroma.from_documents(
286
+ documents=[doc],
287
+ embedding=embed_model,
288
+ persist_directory="chroma_db_dir_sermon", # Local mode with in-memory storage only
289
+ collection_name="sermon_lab_ai"
290
+ )
291
+ retriever = vectorstore.as_retriever(
292
+ search_kwargs={"k": 3}
293
+ )
294
  answer = askQuestionEx(
295
  "",
296
  chain,