aadnk commited on
Commit
51156ef
1 Parent(s): 99ae9fb

Add support for setting default language or model via the CLI

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -738,7 +738,7 @@ if __name__ == '__main__':
738
  help="The port to bind to.") # 7860
739
  parser.add_argument("--queue_concurrency_count", type=int, default=default_app_config.queue_concurrency_count, \
740
  help="The number of concurrent requests to process.") # 1
741
- parser.add_argument("--default_model_name", type=str, choices=whisper_models, default=default_app_config.default_model_name, \
742
  help="The default model name.") # medium
743
  parser.add_argument("--default_vad", type=str, default=default_app_config.default_vad, \
744
  help="The default VAD.") # silero-vad
@@ -760,7 +760,9 @@ if __name__ == '__main__':
760
  help="the compute type to use for inference")
761
  parser.add_argument("--threads", type=optional_int, default=0,
762
  help="number of threads used by torch for CPU inference; supercedes MKL_NUM_THREADS/OMP_NUM_THREADS")
763
-
 
 
764
  parser.add_argument('--auth_token', type=str, default=default_app_config.auth_token, help='HuggingFace API Token (optional)')
765
  parser.add_argument("--diarization", type=str2bool, default=default_app_config.diarization, \
766
  help="whether to perform speaker diarization")
 
738
  help="The port to bind to.") # 7860
739
  parser.add_argument("--queue_concurrency_count", type=int, default=default_app_config.queue_concurrency_count, \
740
  help="The number of concurrent requests to process.") # 1
741
+ parser.add_argument("--default_model_name", "--model", type=str, choices=whisper_models, default=default_app_config.default_model_name, \
742
  help="The default model name.") # medium
743
  parser.add_argument("--default_vad", type=str, default=default_app_config.default_vad, \
744
  help="The default VAD.") # silero-vad
 
760
  help="the compute type to use for inference")
761
  parser.add_argument("--threads", type=optional_int, default=0,
762
  help="number of threads used by torch for CPU inference; supercedes MKL_NUM_THREADS/OMP_NUM_THREADS")
763
+ parser.add_argument("--language", type=str, default=default_app_config.language, choices=sorted(get_language_names()), \
764
+ help="language spoken in the audio, specify None to perform language detection")
765
+
766
  parser.add_argument('--auth_token', type=str, default=default_app_config.auth_token, help='HuggingFace API Token (optional)')
767
  parser.add_argument("--diarization", type=str2bool, default=default_app_config.diarization, \
768
  help="whether to perform speaker diarization")