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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -90,6 +90,10 @@ if uploaded_file is not None:
90
  # Create a PowerPoint presentation
91
  prs = Presentation()
92
 
 
 
 
 
93
  for paragraph in paragraphs:
94
  summary = summarizer(paragraph, max_length=(len(paragraph) / 2), min_length=10, do_sample=False)
95
  summary_text = add_line_breaks_to_summary(summary[0]['summary_text'], 80)
@@ -105,10 +109,10 @@ if uploaded_file is not None:
105
  # Create a slide
106
  slide = prs.slides.add_slide(prs.slide_layouts[5])
107
 
108
- # Add the image to the slide at the center (resized to 500x500 pixels)
109
- left = (prs.slide_width - width) / 2
110
- top = (prs.slide_height - height) / 2
111
- pic = slide.shapes.add_picture(temp_img_path, left, top, width, height)
112
 
113
  # Add the paragraph to the slide at the top
114
  left = Inches(1)
 
90
  # Create a PowerPoint presentation
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)
99
  summary_text = add_line_breaks_to_summary(summary[0]['summary_text'], 80)
 
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)