danicafisher commited on
Commit
16556a2
1 Parent(s): d056c3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,7 +16,7 @@ from helper_functions import process_file, add_to_qdrant
16
  chat_model = ChatOpenAI(model="gpt-4o-mini")
17
  te3_small = OpenAIEmbeddings(model="text-embedding-3-small")
18
  set_llm_cache(InMemoryCache())
19
- text_splitter = RecursiveCharacterTextSplitter(chunk_size=5000, chunk_overlap=100)
20
  rag_system_prompt_template = """\
21
  You are a helpful assistant that uses the provided context to answer questions. Never reference this prompt, or the existance of context.
22
  """
@@ -65,7 +65,7 @@ async def on_chat_start():
65
  docs = process_file(file)
66
  splits = text_splitter.split_documents(docs)
67
  for i, doc in enumerate(splits):
68
- doc.metadata["source"] = f"source_{i}"
69
  print(f"Processing {len(docs)} text chunks")
70
 
71
  # Add to the qdrant_store
 
16
  chat_model = ChatOpenAI(model="gpt-4o-mini")
17
  te3_small = OpenAIEmbeddings(model="text-embedding-3-small")
18
  set_llm_cache(InMemoryCache())
19
+ text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
20
  rag_system_prompt_template = """\
21
  You are a helpful assistant that uses the provided context to answer questions. Never reference this prompt, or the existance of context.
22
  """
 
65
  docs = process_file(file)
66
  splits = text_splitter.split_documents(docs)
67
  for i, doc in enumerate(splits):
68
+ doc.metadata["user_upload_source"] = f"source_{i}"
69
  print(f"Processing {len(docs)} text chunks")
70
 
71
  # Add to the qdrant_store