Spaces:
Sleeping
Sleeping
Spencer525
commited on
Commit
•
d211841
1
Parent(s):
b511360
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ async def initialize_gemini(file_path, question):
|
|
24 |
if os.path.exists(file_path):
|
25 |
pdf_loader = PyPDFLoader(file_path)
|
26 |
pages = pdf_loader.load_and_split()
|
27 |
-
context = "\n".join(str(page.page_content) for page in pages[:
|
28 |
stuff_chain = load_qa_chain(model, chain_type="stuff", prompt=prompt)
|
29 |
stuff_answer = stuff_chain({"input_documents": pages, "question": question, "context": context}, return_only_outputs=True)
|
30 |
return stuff_answer['output_text']
|
|
|
24 |
if os.path.exists(file_path):
|
25 |
pdf_loader = PyPDFLoader(file_path)
|
26 |
pages = pdf_loader.load_and_split()
|
27 |
+
context = "\n".join(str(page.page_content) for page in pages[:100])
|
28 |
stuff_chain = load_qa_chain(model, chain_type="stuff", prompt=prompt)
|
29 |
stuff_answer = stuff_chain({"input_documents": pages, "question": question, "context": context}, return_only_outputs=True)
|
30 |
return stuff_answer['output_text']
|