xinjli / allosaurus

Allosaurus is a pretrained universal phone recognizer for more than 2000 languages
GNU General Public License v3.0
532 stars 85 forks source link

Checking the full language list raised IndexError #25

Open yistLin opened 3 years ago

yistLin commented 3 years ago

While I'm checking the full language list with python -m allosaurus.bin.list_lan, the executable raised IndexError. The following is the error message:

Traceback (most recent call last):
  File "/home/yist/.pyenv/versions/3.8.5/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/yist/.pyenv/versions/3.8.5/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/yist/.pyenv/versions/3.8.5/lib/python3.8/site-packages/allosaurus/bin/list_lang.py", line 13, in <module>
    model_path = get_model_path(args.model)
  File "/home/yist/.pyenv/versions/3.8.5/lib/python3.8/site-packages/allosaurus/model.py", line 27, in get_model_path
    resolved_model_name = resolve_model_name(model_name)
  File "/home/yist/.pyenv/versions/3.8.5/lib/python3.8/site-packages/allosaurus/model.py", line 76, in resolve_model_name
    return models[0].name
IndexError: list index out of range
yistLin commented 3 years ago

But right after I downloaded the pretrained models, it works just fine.

xinjli commented 3 years ago

Hi, thanks for reporting this. We will fix it to download the model if not exists.

Thanks!