import gradio as gr from PyPDF2 import PdfReader from transformers import AutoModelForSeq2SeqLM, AutoTokenizer from gtts import gTTS from io import BytesIO import re import os model_name = "pszemraj/led-base-book-summary" model = AutoModelForSeq2SeqLM.from_pretrained(model_name) tokenizer = AutoTokenizer.from_pretrained(model_name) def extract_first_sentence(text): sentences = re.split(r'(?