|
4 | 4 | [-sil {afr,amh,ara,arg,asm,aze,ben,bos,bul,cat,ces,cmn,cym,dan,deu,ell,eng,epo,est,eus,fas,fin,fra,gla,gle,glg,grc,grn,guj,heb,hin,hrv,hun,hye,ina,ind,isl,ita,jbo,jpn,kal,kan,kat,kir,kor,kur,lat,lav,lfn,lit,mal,mar,mkd,mlt,msa,mya,nah,nep,nld,nor,ori,orm,pan,pap,pol,por,ron,rus,sin,slk,slv,spa,sqi,srp,swa,swe,tam,tat,tel,tha,tsn,tur,ukr,urd,vie,yue,zho}]
|
5 | 5 | [-fos] [-tod TRAINING_OUTPUT_DIRECTORY] [-o OUTPUT] [-t TRANSLATE] [-os OFFSET_SECONDS]
|
6 | 6 | [-ml {afr,amh,ara,arg,asm,aze,ben,bos,bul,cat,ces,cmn,cym,dan,deu,ell,eng,epo,est,eus,fas,fin,fra,gla,gle,glg,grc,grn,guj,heb,hin,hrv,hun,hye,ina,ind,isl,ita,jbo,jpn,kal,kan,kat,kir,kor,kur,lat,lav,lfn,lit,mal,mar,mkd,mlt,msa,mya,nah,nep,nld,nor,ori,orm,pan,pap,pol,por,ron,rus,sin,slk,slv,spa,sqi,srp,swa,swe,tam,tat,tel,tha,tsn,tur,ukr,urd,vie,yue,zho}]
|
7 |
| - [-mr {whisper}] [-mf {tiny,tiny.en,small,medium,medium.en,base,base.en,large-v1,large-v2,large-v3,large,turbo}] [-ip INITIAL_PROMPT] [-tr {helsinki-nlp,whisper,facebook-mbart}] |
8 |
| - [-tf TRANSLATION_FLAVOUR] [-mpt MEDIA_PROCESS_TIMEOUT] [-sat SEGMENT_ALIGNMENT_TIMEOUT] [-lgs] [-d] [-q] [-ver] |
| 7 | + [-mr {whisper}] [-mf {tiny,tiny.en,small,medium,medium.en,base,base.en,large-v1,large-v2,large-v3,large,turbo}] [-ip INITIAL_PROMPT] [-mcl MAX_CHAR_LENGTH] |
| 8 | + [-tr {helsinki-nlp,whisper,facebook-mbart,facebook-m2m100}] [-tf TRANSLATION_FLAVOUR] [-mpt MEDIA_PROCESS_TIMEOUT] [-sat SEGMENT_ALIGNMENT_TIMEOUT] [-wt] [-upp] [-lgs] [-d] [-q] [-ver] |
9 | 9 |
|
10 | 10 | Subaligner command line interface
|
11 | 11 |
|
12 | 12 | optional arguments:
|
13 | 13 | -h, --help show this help message and exit
|
14 | 14 | -s SUBTITLE_PATH [SUBTITLE_PATH ...], --subtitle_path SUBTITLE_PATH [SUBTITLE_PATH ...]
|
15 |
| - File path or URL to the subtitle file (Extensions of supported subtitles: .ass, .smi, .scc, .vtt, .stl, .txt, .sbv, .ssa, .sub, .ttml, .xml, .srt, .ytt, .dfxp, .sami, .tmp) or selector for the embedded subtitle (e.g., embedded:page_num=888 or embedded:stream_index=0) |
| 15 | + File path or URL to the subtitle file (Extensions of supported subtitles: .vtt, .srt, .ass, .sbv, .sub, .txt, .ttml, .ssa, .dfxp, .ytt, .stl, .tmp, .smi, .scc, .sami, .xml) or selector for the embedded subtitle (e.g., embedded:page_num=888 or embedded:stream_index=0) |
16 | 16 | -l MAX_LOGLOSS, --max_logloss MAX_LOGLOSS
|
17 | 17 | Max global log loss for alignment
|
18 | 18 | -so, --stretch_on Switch on stretch on subtitles)
|
|
36 | 36 | Flavour variation for a specific LLM recipe supporting transcription
|
37 | 37 | -ip INITIAL_PROMPT, --initial_prompt INITIAL_PROMPT
|
38 | 38 | Optional text to provide the transcribing context or specific phrases
|
39 |
| - -tr {helsinki-nlp,whisper,facebook-mbart}, --translation_recipe {helsinki-nlp,whisper,facebook-mbart} |
| 39 | + -mcl MAX_CHAR_LENGTH, --max_char_length MAX_CHAR_LENGTH |
| 40 | + Maximum number of characters for each generated subtitle segment |
| 41 | + -tr {helsinki-nlp,whisper,facebook-mbart,facebook-m2m100}, --translation_recipe {helsinki-nlp,whisper,facebook-mbart,facebook-m2m100} |
40 | 42 | LLM recipe used for translating subtitles
|
41 | 43 | -tf TRANSLATION_FLAVOUR, --translation_flavour TRANSLATION_FLAVOUR
|
42 | 44 | Flavour variation for a specific LLM recipe supporting translation
|
43 | 45 | -mpt MEDIA_PROCESS_TIMEOUT, --media_process_timeout MEDIA_PROCESS_TIMEOUT
|
44 | 46 | Maximum waiting time in seconds when processing media files
|
45 | 47 | -sat SEGMENT_ALIGNMENT_TIMEOUT, --segment_alignment_timeout SEGMENT_ALIGNMENT_TIMEOUT
|
46 | 48 | Maximum waiting time in seconds when aligning each segment
|
| 49 | + -upp, --use_prior_prompting |
| 50 | + Whether to use the previous subtitle cue as the current prompt. |
47 | 51 | -lgs, --languages Print out language codes used for stretch and translation
|
48 | 52 | -d, --debug Print out debugging information
|
49 | 53 | -q, --quiet Switch off logging information
|
@@ -225,6 +229,8 @@ def main():
|
225 | 229 | default=60,
|
226 | 230 | help="Maximum waiting time in seconds when aligning each segment"
|
227 | 231 | )
|
| 232 | + parser.add_argument("-upp", "--use_prior_prompting", action="store_true", |
| 233 | + help="Whether to use the previous subtitle cue as the current prompt.") |
228 | 234 | parser.add_argument("-lgs", "--languages", action="store_true",
|
229 | 235 | help="Print out language codes used for stretch and translation")
|
230 | 236 | parser.add_argument("-d", "--debug", action="store_true",
|
@@ -371,7 +377,8 @@ def main():
|
371 | 377 | subtitle, frame_rate = transcriber.transcribe_with_subtitle_as_prompts(video_file_path=local_video_path,
|
372 | 378 | subtitle_file_path=local_subtitle_path,
|
373 | 379 | language_code=stretch_in_lang,
|
374 |
| - max_char_length=FLAGS.max_char_length) |
| 380 | + max_char_length=FLAGS.max_char_length, |
| 381 | + use_prior_prompting=FLAGS.use_prior_prompting) |
375 | 382 | aligned_subs = subtitle.subs
|
376 | 383 | else:
|
377 | 384 | print("ERROR: Unknown mode {}".format(FLAGS.mode))
|
|
0 commit comments