Alex Volkov commited on
Commit
fb5c5d4
·
1 Parent(s): 5556030

Added model size as the default (before args)

Browse files
Files changed (1) hide show
  1. utils/utils.py +3 -1
utils/utils.py CHANGED
@@ -1,5 +1,7 @@
1
  import whisper
2
  import argparse
 
 
3
  def str2bool(string):
4
  str2val = {"True": True, "False": False}
5
  if string in str2val:
@@ -15,7 +17,7 @@ def get_args():
15
  help="Wether to share with gradio public or not")
16
  parser.add_argument("--preload", type=str2bool, default=True,
17
  help="Should the model be preloaded on script launch. Disable for faster debug")
18
- parser.add_argument("--model", default="medium",
19
  choices=whisper.available_models(), help="name of the Whisper model to use")
20
 
21
  args = parser.parse_args().__dict__
 
1
  import whisper
2
  import argparse
3
+ import os
4
+
5
  def str2bool(string):
6
  str2val = {"True": True, "False": False}
7
  if string in str2val:
 
17
  help="Wether to share with gradio public or not")
18
  parser.add_argument("--preload", type=str2bool, default=True,
19
  help="Should the model be preloaded on script launch. Disable for faster debug")
20
+ parser.add_argument("--model", default=os.environ.get('MODEL_SIZE', "medium"),
21
  choices=whisper.available_models(), help="name of the Whisper model to use")
22
 
23
  args = parser.parse_args().__dict__