I’m trying to update the LibreTranslate package in NixOS and see that this package now depends on a fork of argos-translate (argos-translate-lt). Is this a long-term fork or a temporary fork? I’d rather not keep multiple versions around.
It’s temporary. The two are virtually the same. There’s just a fix for Do not set compute type by pierotofy · Pull Request #511 · argosopentech/argos-translate · GitHub merged and I’ve removed the dependency on torch (and stanza) in the fork, in order to make LibreTranslate lighter to download (and fix installation issues that plague torch).
Thanks! In that case, I’ll keep the dependency on the upstream argostranslate (for the moment).
I merged this change.
I’d like to better support installing Argos Translate without PyTorch but I don’t know a great way to do this for a Python package. I don’t think there’s a good mechanism in Pip for optional dependencies. Having a forked version of Argos Translate for LibreTranslate seems like a good solution for now. I might just fully remove Stanza (which depends on PyTorch) at some point which would make this unnecessary.
I’m hardly an expert on this, but it looks like you can mark a dependency as optional by appending [some_feature_name] after the dependency. E.g.:
ctranslate2>=4.0,<5
sentencepiece>=0.2.0,<0.3
spacy [spacy]
stanza [stanza] == 1.10.1
packaging
sacremoses>=0.0.53,<0.2
minisbd
Then you’d run pip install argos-translate[stanza] to install it with stanza support.
Oh good tip thanks. That feature would work perfectly for this usecase.
I made a GitHub ticket to look into this when I get a chance