Lhumpal commited on
Commit
3ac0722
·
verified ·
1 Parent(s): db20b75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -56,7 +56,7 @@ concise_text = dataset["concise"]["text"]
56
  concise_text_string = "".join(concise_text)
57
 
58
  # Chunk and index the documents
59
- chunks = chunk_text(concise_text_string, chunk_size=300) # chunks are 30 words each
60
  # Build the vectorsore
61
  vectorstore = build_faiss_vectorstore(chunks)
62
 
@@ -67,7 +67,7 @@ async def chat(request: ChatRequest):
67
  client = genai.Client(api_key=google_api_key)
68
 
69
  # Retrieve relevant text
70
- results = retrieve(request.message, vectorstore)
71
  formatted_results = "\n\n".join(results)
72
 
73
  rag_prompt = f"""You have access to the following relevant information retrieved based on the user's query:
 
56
  concise_text_string = "".join(concise_text)
57
 
58
  # Chunk and index the documents
59
+ chunks = chunk_text(concise_text_string, chunk_size=450)
60
  # Build the vectorsore
61
  vectorstore = build_faiss_vectorstore(chunks)
62
 
 
67
  client = genai.Client(api_key=google_api_key)
68
 
69
  # Retrieve relevant text
70
+ results = retrieve(request.message, vectorstore, top_k=10)
71
  formatted_results = "\n\n".join(results)
72
 
73
  rag_prompt = f"""You have access to the following relevant information retrieved based on the user's query: