browsermt / bergamot-translator

Cross platform C++ library focusing on optimized machine translation on the consumer-grade device.
http://browser.mt
Mozilla Public License 2.0
327 stars 36 forks source link

fix downloading of models in the python binding #472

Closed bjesus closed 4 months ago

bjesus commented 4 months ago

models come in files named like csen.student.base.v1.cd5418ba6a412fc7.tar.gz, but the directory they create when extracted are named like csen.student.base. we therefore need to remove not just the extension but everything following and including the 3rd period

XapaJIaMnu commented 4 months ago

It's probably more robust to take the first 3 rather than remove bits from the back. Could you change your pr to do that? (and sorry this project has lost lots of maintainers)

bjesus commented 4 months ago

Hey @XapaJIaMnu ! thanks for the quick reply. I'm pretty sure [:3] takes the first three, but perhaps I'm not understanding you correctly?

XapaJIaMnu commented 4 months ago

... I shouldn't reply to things when I'm tired..