Spaces:
Runtime error
Runtime error
Update app.py
Browse files89 unmodified lines909192939495969798999 unmodified lines1091101111121131141151161171181193 unmodified lines12312412512612712812913013113213313413589 unmodified lines# Create a PowerPoint presentationprs = Presentation()# Set the desired width and height for the imageimage_width = Inches(5)image_height = Inches(5)for paragraph in paragraphs:summary = summarizer(paragraph, max_length=(len(paragraph) / 2), min_length=10, do_sample=False)summary_text = add_line_breaks_to_summary(summary[0]['summary_text'], 80)9 unmodified lines# Create a slideslide = prs.slides.add_slide(prs.slide_layouts[5])# Add the paragraph to the slide at the topleft = Inches(1)top = Inches(1)width = Inches(8) # Adjust the width as neededheight = Inches(1.5)txBox = slide.shapes.add_textbox(left, top, width, height)tf = txBox.text_framep = tf.add_paragraph()3 unmodified linesp.text = summary_textp.space_after = Pt(0) # Adjust the spacing as needed# Declare the image_top variable and set it to place the image at the bottomimage_left = (prs.slide_width - image_width) / 2image_top = prs.slide_height - image_height - Inches(1) # Adjust the Inches(1) value as needed# Add the image to the slide at the bottompic = slide.shapes.add_picture(temp_img_path, image_left, image_top, image_width, image_height)i += 1# Save the PowerPoint presentation89 unmodified lines9091929394959 unmodified lines1051061071081091101111121131141151161171181191203 unmodified lines12412512612712812989 unmodified lines# Create a PowerPoint presentationprs = Presentation()for paragraph in paragraphs:summary = summarizer(paragraph, max_length=(len(paragraph) / 2), min_length=10, do_sample=False)summary_text = add_line_breaks_to_summary(summary[0]['summary_text'], 80)9 unmodified lines# Create a slideslide = prs.slides.add_slide(prs.slide_layouts[5])# Add the image to the slide at the bottomleft = (prs.slide_width - Inches(3)) / 2top = prs.slide_height - Inches(3)pic = slide.shapes.add_picture(temp_img_path, left, top, Inches(3), Inches(3))# Add the paragraph to the slide at the topleft = Inches(1)top = Inches(1)width = Inches(8) # Adjust the width as neededheight = prs.slide_height - Inches(4) # Adjust the height as neededtxBox = slide.shapes.add_textbox(left, top, width, height)tf = txBox.text_framep = tf.add_paragraph()3 unmodified linesp.text = summary_textp.space_after = Pt(0) # Adjust the spacing as neededi += 1# Save the PowerPoint presentation
app.py+6-12