Technocoloredgeek commited on
Commit
f9aa448
·
verified ·
1 Parent(s): 6f82650

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -54,7 +54,7 @@ async def fetch_pdf(session, url):
54
  async def process_pdf(pdf_content):
55
  pdf_reader = PdfReader(BytesIO(pdf_content))
56
  text = "\n".join([page.extract_text() for page in pdf_reader.pages])
57
- text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
58
  return text_splitter.split_text(text)
59
 
60
  @st.cache_resource
@@ -84,11 +84,11 @@ async def main():
84
  return RetrievalAugmentedQAPipeline(vector_db=vector_db, llm=chat_openai)
85
 
86
  # Streamlit UI
87
- st.title("AI Bill of Rights Q&A")
88
 
89
  pipeline = initialize_pipeline()
90
 
91
- user_query = st.text_input("Enter your question about the AI Bill of Rights:")
92
 
93
  if user_query:
94
  with st.spinner("Generating response..."):
 
54
  async def process_pdf(pdf_content):
55
  pdf_reader = PdfReader(BytesIO(pdf_content))
56
  text = "\n".join([page.extract_text() for page in pdf_reader.pages])
57
+ text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=40)
58
  return text_splitter.split_text(text)
59
 
60
  @st.cache_resource
 
84
  return RetrievalAugmentedQAPipeline(vector_db=vector_db, llm=chat_openai)
85
 
86
  # Streamlit UI
87
+ st.title("Ask About AI!")
88
 
89
  pipeline = initialize_pipeline()
90
 
91
+ user_query = st.text_input("Enter your question about AI:")
92
 
93
  if user_query:
94
  with st.spinner("Generating response..."):