bupa1018 commited on
Commit
f458872
·
1 Parent(s): d08faa6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -302,8 +302,9 @@ def query_chroma(vectorstore, query, k):
302
  return chunks_with_references
303
 
304
  def rag_workflow(query):
 
305
  docs = query_chroma(vectorstore, query, k=10)
306
- context = "\n\n".join([doc for doc, _ in docs])
307
  references = "\n".join([f"[{i+1}] {ref}" for i, (_, ref) in enumerate(docs)])
308
  print(f"Context for the query:\n{context}\n")
309
  print(f"References for the query:\n{references}\n")
@@ -344,7 +345,7 @@ def initialize():
344
  print(f"Total number of doc_chunks: {len(doc_chunks)}")
345
 
346
  vectorstore = setup_chroma(doc_chunks, EMBEDDING_MODEL_NAME, PERSIST_DIRECTORY)
347
- # vectorstore = setup_chroma(chunks, EMBEDDING_MODEL_NAME, PERSIST_DIRECTORY)
348
  llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
349
 
350
 
 
302
  return chunks_with_references
303
 
304
  def rag_workflow(query):
305
+ retrieved_doc_chunks = query_chroma(vectorstore, query, k=10)
306
  docs = query_chroma(vectorstore, query, k=10)
307
+ context = "\n\n".join([doc_chunk for doc_chunk, _ in retrieved_doc_chunks])
308
  references = "\n".join([f"[{i+1}] {ref}" for i, (_, ref) in enumerate(docs)])
309
  print(f"Context for the query:\n{context}\n")
310
  print(f"References for the query:\n{references}\n")
 
345
  print(f"Total number of doc_chunks: {len(doc_chunks)}")
346
 
347
  vectorstore = setup_chroma(doc_chunks, EMBEDDING_MODEL_NAME, PERSIST_DIRECTORY)
348
+ # codestore = setup_chroma(code_chunks, EMBEDDING_MODEL_NAME, PERSIST_DIRECTORY)
349
  llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
350
 
351