JiaenLiu commited on
Commit
08c7492
·
1 Parent(s): ddd11b0

Former-commit-id: c74d132aca0567702f161ce0db07f18eac008dc2

Files changed (1) hide show
  1. pipeline.py +2 -3
pipeline.py CHANGED
@@ -89,8 +89,8 @@ if args.link is not None and args.video_file is None:
89
  elif args.video_file is not None:
90
  # Read from local
91
  video_path = args.video_file
92
- audio_path = "{DOWNLOAD_PATH}/audio/{VIDEO_NAME}.mp3".format(DOWNLOAD_PATH, VIDEO_NAME)
93
- if args.audio_file is not None or os.path.exists(audio_path):
94
  audio_file= open(args.audio_file, "rb")
95
  audio_path = args.audio_file
96
  else:
@@ -265,7 +265,6 @@ for sentence, range in tqdm(zip(script_arr, range_arr)):
265
  flag = True
266
  # add read-time output back and modify the post-processing by using one batch as an unit.
267
  srt.set_translation(translate, range, model_name)
268
-
269
  add_length = srt.check_len_and_split_range(range, threshold)
270
  srt.realtime_write_srt(f"{RESULT_PATH}/{VIDEO_NAME}/{VIDEO_NAME}_zh.srt",range, add_length,segidx)
271
  # srt.realtime_bilingual_write_srt(f"{RESULT_PATH}/{VIDEO_NAME}/{VIDEO_NAME}_bi.srt",range, add_length,segidx)
 
89
  elif args.video_file is not None:
90
  # Read from local
91
  video_path = args.video_file
92
+ # audio_path = "{DOWNLOAD_PATH}/audio/{VIDEO_NAME}.mp3".format(DOWNLOAD_PATH, VIDEO_NAME)
93
+ if args.audio_file is not None:
94
  audio_file= open(args.audio_file, "rb")
95
  audio_path = args.audio_file
96
  else:
 
265
  flag = True
266
  # add read-time output back and modify the post-processing by using one batch as an unit.
267
  srt.set_translation(translate, range, model_name)
 
268
  add_length = srt.check_len_and_split_range(range, threshold)
269
  srt.realtime_write_srt(f"{RESULT_PATH}/{VIDEO_NAME}/{VIDEO_NAME}_zh.srt",range, add_length,segidx)
270
  # srt.realtime_bilingual_write_srt(f"{RESULT_PATH}/{VIDEO_NAME}/{VIDEO_NAME}_bi.srt",range, add_length,segidx)