Python package seems broken
I can't seem to figure out how to use the python package, and I suspect it's broken.
❯ bergamot download
❯ bergamot ls
Available models:
It never seem to find any model or to let you download any model.
This fixes a bug with downloading: https://github.com/browsermt/bergamot-translator/pull/472
#474 is intended to fix another bug with downloading models.
#472 works well with the default browsermt repo but it has issues with the opus repo as files are named differently there. For example the eng-fin-tiny model has the filename eng-fin.transformer-tiny11.tar.gz. So removing everything after the third . gives you eng-fin.transformer-tiny11.tar which is not the name of the extracted directory. I'm not sure if there is any one-size-fits-all solution though, if different repos follow different file naming conventions for their models. Maybe there should be a separate Repository subclass for opus which defines different name-stripping logic.