Flo161 commited on
Commit
fa42f9e
·
1 Parent(s): 57d0966

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -91,8 +91,8 @@ if uploaded_file is not None:
91
  prs = Presentation()
92
 
93
  # Set the desired width and height for the image
94
- image_width = Inches(3)
95
- image_height = Inches(3)
96
 
97
  for paragraph in paragraphs:
98
  summary = summarizer(paragraph, max_length=(len(paragraph) / 2), min_length=10, do_sample=False)
@@ -109,11 +109,6 @@ if uploaded_file is not None:
109
  # Create a slide
110
  slide = prs.slides.add_slide(prs.slide_layouts[5])
111
 
112
- # Add the image to the slide at the center
113
- left = (prs.slide_width - image_width) / 2
114
- top = (prs.slide_height - image_height) / 2
115
- pic = slide.shapes.add_picture(temp_img_path, left, top, image_width, image_height)
116
-
117
  # Add the paragraph to the slide at the top
118
  left = Inches(1)
119
  top = Inches(1)
@@ -128,6 +123,13 @@ if uploaded_file is not None:
128
  p.text = summary_text
129
  p.space_after = Pt(0) # Adjust the spacing as needed
130
 
 
 
 
 
 
 
 
131
  i += 1
132
 
133
  # Save the PowerPoint presentation
 
91
  prs = Presentation()
92
 
93
  # Set the desired width and height for the image
94
+ image_width = Inches(5)
95
+ image_height = Inches(5)
96
 
97
  for paragraph in paragraphs:
98
  summary = summarizer(paragraph, max_length=(len(paragraph) / 2), min_length=10, do_sample=False)
 
109
  # Create a slide
110
  slide = prs.slides.add_slide(prs.slide_layouts[5])
111
 
 
 
 
 
 
112
  # Add the paragraph to the slide at the top
113
  left = Inches(1)
114
  top = Inches(1)
 
123
  p.text = summary_text
124
  p.space_after = Pt(0) # Adjust the spacing as needed
125
 
126
+ # Declare the image_top variable and set it to place the image at the bottom
127
+ image_left = (prs.slide_width - image_width) / 2
128
+ image_top = prs.slide_height - image_height - Inches(1) # Adjust the Inches(1) value as needed
129
+
130
+ # Add the image to the slide at the bottom
131
+ pic = slide.shapes.add_picture(temp_img_path, image_left, image_top, image_width, image_height)
132
+
133
  i += 1
134
 
135
  # Save the PowerPoint presentation