Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from generate_transcript import TranscriptProcessor
|
|
| 6 |
from generate_audio import TTSGenerator
|
| 7 |
import pickle
|
| 8 |
import os
|
| 9 |
-
import
|
| 10 |
|
| 11 |
# Define paths
|
| 12 |
pdf_path = './resources/uploaded_pdf.pdf'
|
|
@@ -17,7 +17,7 @@ audio_output_path = 'final_podcast_audio.mp3'
|
|
| 17 |
|
| 18 |
|
| 19 |
# Combined function to perform all steps sequentially
|
| 20 |
-
@
|
| 21 |
def process_pdf_to_podcast(pdf_file):
|
| 22 |
# Step 1: Extract Text from PDF
|
| 23 |
with open(pdf_path, 'wb') as f:
|
|
@@ -54,7 +54,7 @@ def process_pdf_to_podcast(pdf_file):
|
|
| 54 |
|
| 55 |
|
| 56 |
# Final Step: Generate Audio after optional adjustments
|
| 57 |
-
@
|
| 58 |
def generate_audio_from_modified_text(tts_ready_text):
|
| 59 |
# Save any modified TTS-ready transcript
|
| 60 |
with open(tts_ready_path, 'wb') as f:
|
|
|
|
| 6 |
from generate_audio import TTSGenerator
|
| 7 |
import pickle
|
| 8 |
import os
|
| 9 |
+
import spaces
|
| 10 |
|
| 11 |
# Define paths
|
| 12 |
pdf_path = './resources/uploaded_pdf.pdf'
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
# Combined function to perform all steps sequentially
|
| 20 |
+
@spaces.GPU
|
| 21 |
def process_pdf_to_podcast(pdf_file):
|
| 22 |
# Step 1: Extract Text from PDF
|
| 23 |
with open(pdf_path, 'wb') as f:
|
|
|
|
| 54 |
|
| 55 |
|
| 56 |
# Final Step: Generate Audio after optional adjustments
|
| 57 |
+
@spaces.GPU
|
| 58 |
def generate_audio_from_modified_text(tts_ready_text):
|
| 59 |
# Save any modified TTS-ready transcript
|
| 60 |
with open(tts_ready_path, 'wb') as f:
|