Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=
|
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("
|
88 |
|
89 |
pipeline = initialize_pipeline()
|
90 |
|
91 |
-
user_query = st.text_input("Enter your question about
|
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..."):
|