smajumdar commited on
Commit
ddc1d52
1 Parent(s): a8ddd76

Force prealloc cause waiting apparantly doenst work

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +14 -6
  3. requirements.txt +1 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🐠
4
  colorFrom: blue
5
  colorTo: gray
6
  sdk: gradio
7
- sdk_version: 3.12
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
4
  colorFrom: blue
5
  colorTo: gray
6
  sdk: gradio
7
+ sdk_version: 3.16
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
app.py CHANGED
@@ -95,11 +95,18 @@ SUPPORTED_MODEL_NAMES = sorted(list(SUPPORTED_MODEL_NAMES))
95
  model_dict = {}
96
  for model_name in SUPPORTED_MODEL_NAMES:
97
  try:
98
- # iface = gr.Interface.load(f'models/{model_name}')
99
- model_dict[model_name] = None
 
 
100
  except:
101
  pass
102
 
 
 
 
 
 
103
  SUPPORTED_LANG_MODEL_DICT = {}
104
  for lang in SUPPORTED_LANGUAGES:
105
  for model_id in SUPPORTED_MODEL_NAMES:
@@ -373,10 +380,11 @@ def infer_audio(model_name: str, audio_file: str) -> str:
373
 
374
  if model is None:
375
  # Load the gradio interface
376
- try:
377
- iface = gr.Interface.load(f'models/{model_name}')
378
- except:
379
- iface = None
 
380
 
381
  if iface is not None:
382
  # Update model cache
 
95
  model_dict = {}
96
  for model_name in SUPPORTED_MODEL_NAMES:
97
  try:
98
+ iface = gr.Interface.load(f'models/{model_name}')
99
+ model_dict[model_name] = iface
100
+
101
+ # model_dict[model_name] = None
102
  except:
103
  pass
104
 
105
+ if DEFAULT_EN_MODEL in model_dict:
106
+ # Preemptively load the default EN model
107
+ if model_dict[DEFAULT_EN_MODEL] is None:
108
+ model_dict[DEFAULT_EN_MODEL] = gr.Interface.load(f'models/{DEFAULT_EN_MODEL}')
109
+
110
  SUPPORTED_LANG_MODEL_DICT = {}
111
  for lang in SUPPORTED_LANGUAGES:
112
  for model_id in SUPPORTED_MODEL_NAMES:
 
380
 
381
  if model is None:
382
  # Load the gradio interface
383
+ # try:
384
+ iface = gr.Interface.load(f'models/{model_name}')
385
+ print(iface)
386
+ # except:
387
+ # iface = None
388
 
389
  if iface is not None:
390
  # Update model cache
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- -e git+https://github.com/NVIDIA/NeMo.git@2a6101421f4366ec28bac1165f26fec8eeedea59#egg=nemo_toolkit[all]
2
  pytube
 
1
+ nemo_toolkit[all]
2
  pytube