Spaces:
Runtime error
Runtime error
Update app.py
Browse files3 unmodified lines456789101113 unmodified lines252627282930313233343519 unmodified lines5556575859606162633 unmodified linesfrom transformers import pipelinefrom gtts import gTTSimport osimport pygamefrom threading import Thread# Özetleme modelini yükleyin (T5-small modelini kullanıyoruz)summarizer = pipeline("text2text-generation", model="t5-small", tokenizer="t5-small")13 unmodified linestext += chunkreturn textdef play_audio():pygame.mixer.init()pygame.mixer.music.load("output.mp3")pygame.mixer.music.play()pygame.time.wait(int(pygame.mixer.Sound("output.mp3").get_length() * 1000))def summarize_and_read(pdf_path):# PDF'den metni çıkart19 unmodified linestts = gTTS(text=first_sentence, lang='en')tts.save("output.mp3")# Ses dosyasını oynatmak için arka planda bir thread kullanınaudio_thread = Thread(target=play_audio)audio_thread.start()return first_sentence3 unmodified lines45678913 unmodified lines232425262728293019 unmodified lines50515253545556573 unmodified linesfrom transformers import pipelinefrom gtts import gTTSimport os# Özetleme modelini yükleyin (T5-small modelini kullanıyoruz)summarizer = pipeline("text2text-generation", model="t5-small", tokenizer="t5-small")13 unmodified linestext += chunkreturn textdef play_audio(file_path):os.system(f"start {file_path}")def summarize_and_read(pdf_path):# PDF'den metni çıkart19 unmodified linestts = gTTS(text=first_sentence, lang='en')tts.save("output.mp3")# Ses dosyasını oynatmak için alternative bir yöntem kullanınplay_audio("output.mp3")return first_sentence
app.py+4-10