Nick088 commited on
Commit
9b5d20f
·
verified ·
1 Parent(s): 85ec08e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -299,7 +299,7 @@ def generate_subtitles(audio_file_path, prompt, language, auto_detect_language):
299
 
300
  srt_content = create_srt_from_text(transcription_text)
301
 
302
- # Create temporary file
303
  with tempfile.NamedTemporaryFile(mode="w", delete=False) as temp_srt_file:
304
  temp_srt_path = temp_srt_file.name
305
  temp_srt_file.write(srt_content)
@@ -312,7 +312,8 @@ def generate_subtitles(audio_file_path, prompt, language, auto_detect_language):
312
  except subprocess.CalledProcessError as e:
313
  return None, None, f"Error during subtitle addition: {e}", temp_srt_path # Return the temp_srt_path
314
 
315
- return temp_srt_file, None, None
 
316
 
317
 
318
  with gr.Blocks() as demo:
 
299
 
300
  srt_content = create_srt_from_text(transcription_text)
301
 
302
+ # Create a temporary file for SRT content
303
  with tempfile.NamedTemporaryFile(mode="w", delete=False) as temp_srt_file:
304
  temp_srt_path = temp_srt_file.name
305
  temp_srt_file.write(srt_content)
 
312
  except subprocess.CalledProcessError as e:
313
  return None, None, f"Error during subtitle addition: {e}", temp_srt_path # Return the temp_srt_path
314
 
315
+ # Return the path of the temporary SRT file
316
+ return temp_srt_path, None, None
317
 
318
 
319
  with gr.Blocks() as demo: