Alex Young 2024-04-15
Add a --warmup-file option to pass in a path
@754f3129443010ea200162fd902484bb47429538
whisper_online_server.py
--- whisper_online_server.py
+++ whisper_online_server.py
@@ -10,6 +10,8 @@
 parser.add_argument("--host", type=str, default='localhost')
 parser.add_argument("--port", type=int, default=43007)
 
+parser.add_argument("--warmup-file", type=str, dest="warmup_file")
+
 
 # options from whisper_online
 add_shared_args(parser)
@@ -61,10 +63,9 @@
 
 
 
-demo_audio_path = "cs-maji-2.16k.wav"
-if os.path.exists(demo_audio_path):
+if os.path.exists(args.warmup_file):
     # load the audio into the LRU cache before we start the timer
-    a = load_audio_chunk(demo_audio_path,0,1)
+    a = load_audio_chunk(args.warmup_file,0,1)
 
     # TODO: it should be tested whether it's meaningful
     # warm up the ASR, because the very first transcribe takes much more time than the other
Add a comment
List