worldqwq commited on
Commit
2f9051f
·
1 Parent(s): 0b15a1d

Optimized srt input support

Browse files

Former-commit-id: e66a72b5170100bbb290ccc0ca3e6002337b67ca

Files changed (1) hide show
  1. pipeline.py +4 -2
pipeline.py CHANGED
@@ -195,8 +195,10 @@ if os.path.exists(zh_file):
195
  pass
196
  count += 1
197
  segidx = int(count/4)+1
198
-
199
- with open("{}/{}/{}_en.srt".format(RESULT_PATH, VIDEO_NAME, VIDEO_NAME), "r") as f1, open(temp_file, "a") as f2:
 
 
200
  x = f1.readlines()
201
  #print(len(x))
202
  if count >= len(x):
 
195
  pass
196
  count += 1
197
  segidx = int(count/4)+1
198
+ en_file = "{}/{}/{}_en.srt".format(RESULT_PATH, VIDEO_NAME, VIDEO_NAME)
199
+ if args.srt_file is not None:
200
+ en_file = args.srt_file
201
+ with open(en_file, "r") as f1, open(temp_file, "a") as f2:
202
  x = f1.readlines()
203
  #print(len(x))
204
  if count >= len(x):