yasserrmd commited on
Commit
9bd34f6
·
verified ·
1 Parent(s): f08a3f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -6,6 +6,7 @@ from generate_transcript import TranscriptProcessor
6
  from generate_audio import TTSGenerator
7
  import pickle
8
  import os
 
9
 
10
  # Define paths
11
  pdf_path = './resources/uploaded_pdf.pdf'
@@ -16,6 +17,7 @@ audio_output_path = 'final_podcast_audio.mp3'
16
 
17
 
18
  # Combined function to perform all steps sequentially
 
19
  def process_pdf_to_podcast(pdf_file):
20
  # Step 1: Extract Text from PDF
21
  with open(pdf_path, 'wb') as f:
@@ -52,6 +54,7 @@ def process_pdf_to_podcast(pdf_file):
52
 
53
 
54
  # Final Step: Generate Audio after optional adjustments
 
55
  def generate_audio_from_modified_text(tts_ready_text):
56
  # Save any modified TTS-ready transcript
57
  with open(tts_ready_path, 'wb') as f:
 
6
  from generate_audio import TTSGenerator
7
  import pickle
8
  import os
9
+ import space
10
 
11
  # Define paths
12
  pdf_path = './resources/uploaded_pdf.pdf'
 
17
 
18
 
19
  # Combined function to perform all steps sequentially
20
+ @space.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
+ @space.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: