shukdevdatta123 commited on
Commit
38c1a40
·
verified ·
1 Parent(s): c2740a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -81,9 +81,9 @@ def pdf_chat(pdf_file, text_query, temperature, top_p, max_output_tokens):
81
  if pdf_file is None or not text_query:
82
  return "Please upload a PDF and provide a query."
83
 
84
- # Extract text from the first few pages
85
  doc = fitz.open(pdf_file)
86
- text = "\n".join([page.get_text("text") for page in doc][:5]) # Limit extraction for performance
87
 
88
  messages = [
89
  {"role": "user", "content": [
 
81
  if pdf_file is None or not text_query:
82
  return "Please upload a PDF and provide a query."
83
 
84
+ # Extract text from all pages
85
  doc = fitz.open(pdf_file)
86
+ text = "\n".join([page.get_text("text") for page in doc]) # Extract text from all pages
87
 
88
  messages = [
89
  {"role": "user", "content": [