wanchichen commited on
Commit
4cbe9dc
·
verified ·
1 Parent(s): 0368754

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -21,7 +21,7 @@ access_token = os.environ.get("HF_TOKEN")
21
  ASR_name="pyf98/owsm_ctc_v3.1_1B"
22
  LLM_name="meta-llama/Llama-3.2-1B-Instruct"
23
  TTS_name="kan-bayashi/ljspeech_vits"
24
- ASR_options="pyf98/owsm_ctc_v3.1_1B,espnet/owsm_ctc_v3.2_ft_1B,espnet/owsm_v3.1_ebf,librispeech_asr,whisper-large".split(",")
25
  LLM_options="meta-llama/Llama-3.2-1B-Instruct,HuggingFaceTB/SmolLM2-1.7B-Instruct".split(",")
26
  TTS_options="kan-bayashi/ljspeech_vits,kan-bayashi/libritts_xvector_vits,kan-bayashi/vctk_multi_spk_vits,ChatTTS".split(",")
27
  Eval_options="Latency,TTS Intelligibility,TTS Speech Quality,ASR WER,Text Dialog Metrics"
@@ -227,6 +227,9 @@ def start_warmup():
227
  if opt == ASR_name:
228
  ASR_name = ASR_options[0]
229
  for opt_count in range(len(LLM_options)):
 
 
 
230
  opt = LLM_options[opt_count]
231
  try:
232
  for _ in dialogue_model.handle_LLM_selection(opt):
@@ -235,10 +238,14 @@ def start_warmup():
235
  print(e)
236
  print("Removing " + opt + " from LLM options since it cannot be loaded.")
237
  LLM_options = LLM_options[:opt_count] + LLM_options[(opt_count + 1) :]
 
238
  if opt == LLM_name:
239
  LLM_name = LLM_options[0]
240
  for opt_count in range(len(TTS_options)):
241
  opt = TTS_options[opt_count]
 
 
 
242
  try:
243
  for _ in dialogue_model.handle_TTS_selection(opt):
244
  continue
@@ -246,6 +253,7 @@ def start_warmup():
246
  print(e)
247
  print("Removing " + opt + " from TTS options since it cannot be loaded.")
248
  TTS_options = TTS_options[:opt_count] + TTS_options[(opt_count + 1) :]
 
249
  if opt == TTS_name:
250
  TTS_name = TTS_options[0]
251
  dialogue_model.handle_E2E_selection()
 
21
  ASR_name="pyf98/owsm_ctc_v3.1_1B"
22
  LLM_name="meta-llama/Llama-3.2-1B-Instruct"
23
  TTS_name="kan-bayashi/ljspeech_vits"
24
+ ASR_options="pyf98/owsm_ctc_v3.1_1B,espnet/owsm_ctc_v3.2_ft_1B,espnet/owsm_v3.1_ebf,librispeech_asr".split(",")
25
  LLM_options="meta-llama/Llama-3.2-1B-Instruct,HuggingFaceTB/SmolLM2-1.7B-Instruct".split(",")
26
  TTS_options="kan-bayashi/ljspeech_vits,kan-bayashi/libritts_xvector_vits,kan-bayashi/vctk_multi_spk_vits,ChatTTS".split(",")
27
  Eval_options="Latency,TTS Intelligibility,TTS Speech Quality,ASR WER,Text Dialog Metrics"
 
227
  if opt == ASR_name:
228
  ASR_name = ASR_options[0]
229
  for opt_count in range(len(LLM_options)):
230
+ opt_count-=remove
231
+ if opt_count>=len(LLM_options):
232
+ break
233
  opt = LLM_options[opt_count]
234
  try:
235
  for _ in dialogue_model.handle_LLM_selection(opt):
 
238
  print(e)
239
  print("Removing " + opt + " from LLM options since it cannot be loaded.")
240
  LLM_options = LLM_options[:opt_count] + LLM_options[(opt_count + 1) :]
241
+ remove+=1
242
  if opt == LLM_name:
243
  LLM_name = LLM_options[0]
244
  for opt_count in range(len(TTS_options)):
245
  opt = TTS_options[opt_count]
246
+ opt_count-=remove
247
+ if opt_count>=len(TTS_options):
248
+ break
249
  try:
250
  for _ in dialogue_model.handle_TTS_selection(opt):
251
  continue
 
253
  print(e)
254
  print("Removing " + opt + " from TTS options since it cannot be loaded.")
255
  TTS_options = TTS_options[:opt_count] + TTS_options[(opt_count + 1) :]
256
+ remove+=1
257
  if opt == TTS_name:
258
  TTS_name = TTS_options[0]
259
  dialogue_model.handle_E2E_selection()