@@ -4,14 +4,16 @@ import argparse
44import datetime
55import logging
66import os
7+ import sys
78
89from transcribe import aws , google , whisper
910
1011parser = argparse .ArgumentParser (
1112 prog = "run" , description = "Run transcription generation for sample data"
1213)
1314
14- parser .add_argument ("--output_dir" , help = "Path to a directory to write results" )
15+ parser .add_argument ("--output-dir" , help = "Path to a directory to write results" )
16+ parser .add_argument ("--manifest" , default = "data.csv" , help = "Path to data manifest CSV" )
1517parser .add_argument (
1618 "--only" ,
1719 choices = ["whisper" , "preprocessing" , "aws" , "google" ],
@@ -27,6 +29,10 @@ if output_dir is None:
2729if not os .path .isdir (output_dir ):
2830 os .makedirs (output_dir )
2931
32+ # ensure manifest CSV exists
33+ if not os .path .isfile (args .manifest ):
34+ sys .exit (f"manifest file { args .manifest } doesn't exist" )
35+
3036logging .basicConfig (
3137 filename = os .path .join (output_dir , "transcribe.log" ),
3238 filemode = "a" ,
@@ -35,18 +41,20 @@ logging.basicConfig(
3541 level = logging .INFO ,
3642)
3743
38-
3944# run one of the transcription types individually or run them all
4045if args .only == "whisper" :
41- whisper .run (output_dir )
46+ whisper .run (output_dir , args . manifest )
4247elif args .only == "preprocessing" :
43- whisper .run_preprocessing (output_dir )
48+ whisper .run_preprocessing (output_dir , args . manifest )
4449elif args .only == "aws" :
45- aws .run (output_dir )
50+ aws .run (output_dir , args . manifest )
4651elif args .only == "google" :
47- google .run (output_dir )
52+ google .run (output_dir , args . manifest )
4853else :
49- whisper .run (output_dir )
50- whisper .run_preprocessing (output_dir )
51- aws .run (output_dir )
52- google .run (output_dir )
54+ whisper .run (output_dir , args .manifest )
55+ print ()
56+ whisper .run_preprocessing (output_dir , args .manifest )
57+ print ()
58+ aws .run (output_dir , args .manifest )
59+ print ()
60+ google .run (output_dir , args .manifest )
0 commit comments