NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.07k stars 14.08k forks source link

Packaging request: Argos translation data as Nix packages #250863

Open pacien opened 1 year ago

pacien commented 1 year ago

Project description

python3Packages.argostranslate is an open-source offline translation library written in Python.

It ships a handy command line tool for translating text. But prior to using the program or the library, one has to install language data (translation models) through the argospm command.

It would be nicer to handle this through Nix as well, similarly Aspell and Hunspell dictionaries which are packaged in Nixpkgs.

There is a JSON package index here: https://raw.githubusercontent.com/argosopentech/argospm-index/main/index.json

The translation data directory can be set with the environment variable ARGOS_PACKAGES_DIR.

So it might be feasible to make a wrapper package setting this path properly to use Nix-packaged translation language models.

Metadata


CC: @misuzu (maintainer of python3Packages.argostranslate)

misuzu commented 1 year ago

The way argostranslate handles data files makes it really difficult to package. The only sane way to achieve this it to add support for this use-case to the upstream project, similarly to how whisper and whisper.cpp handles data files.