Closed c6401 closed 9 months ago
Yes, it is possible :)
Let's say you want the Dutch - English model.
nlen.student.tiny
in User/>Your username</Appdata/Roaming/translateLocallymodel_info.json
and copy & paste this text;{
"modelName": "Dutch-English tiny",
"shortName": "nl-en-tiny",
"type": "tiny",
"src": "Dutch",
"trg": "English",
"srcTags": {"nl": "Dutch"},
"trgTag": "en",
"repository": "Bergamot",
"version": 1,
"API": 1
}
config.intgemm8bitalpha.yml
and copy & paste this text;relative-paths: true
models:
- model.nlen.intgemm.alphas.bin
vocabs:
- vocab.nlen.spm
- vocab.nlen.spm
shortlist:
- lex.50.50.nlen.s2t.bin
- false
beam-size: 1
normalize: 1.0
word-penalty: 0
mini-batch: 64
maxi-batch: 1000
maxi-batch-sort: src
workspace: 2000
max-length-factor: 2.0
skip-cost: true
gemm-precision: int8shiftAlphaAll
That's it. Basically you just have to adjust each of their models to fit into translateLocally's format. Keep in mind that you'll have to rename some lines in these two files to adjust for other languages. Some models may also have two vocab files, one for source and one for target.
Edit;
While the config.intgemm8bitalpha.yml
in the example above may work just fine in terms of quality/performance, it may not be ideal for every model. Unfortunately, I can't help you with that at the moment as I don't possess the knowledge of how it works in detail yet.
Awesome, thank you!
the solution works brillliantly
Wondering if I can load some of models from https://github.com/mozilla/firefox-translations-models ?