wholewhale commited on
Commit
f340ee6
·
1 Parent(s): dc60e72

page_content var

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -25,7 +25,7 @@ def summary(self):
25
 
26
  # PDF summary and query using stuffing
27
  def pdf_changes(pdf_doc):
28
- try:
29
  loader = OnlinePDFLoader(pdf_doc.name)
30
  documents = loader.load()
31
  text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
@@ -34,9 +34,10 @@ def pdf_changes(pdf_doc):
34
  # Initialize summary variable
35
  full_summary = ""
36
 
37
- # Divide the text into smaller chunks, for example, 3 pages per chunk
38
- for i in range(0, len(texts), 3):
39
- chunk = " ".join([doc.text for doc in texts[i:i+3]]) # Modified line
 
40
 
41
 
42
  # Load the summarization chain with stuffing method
 
25
 
26
  # PDF summary and query using stuffing
27
  def pdf_changes(pdf_doc):
28
+ try:
29
  loader = OnlinePDFLoader(pdf_doc.name)
30
  documents = loader.load()
31
  text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
 
34
  # Initialize summary variable
35
  full_summary = ""
36
 
37
+ # Divide the text into smaller chunks, for example, 2 pages per chunk
38
+ for i in range(0, len(texts), 2):
39
+ chunk = " ".join([doc.page_content for doc in texts[i:i+2]]) # Replace '.content' with the correct attribute
40
+
41
 
42
 
43
  # Load the summarization chain with stuffing method