argosopentech / argos-translate

Open-source offline translation library written in Python
https://www.argosopentech.com
MIT License
3.77k stars 277 forks source link

add packages torrent 2022-04-30 #432

Closed milahu closed 2 months ago

milahu commented 2 months ago

make the torrent more efficient in terms of disk space

the old torrents require unpacking archives which needs double the disk space to install and seed all models

this torrent allows to install via symlinks

packages/readme.txt

to install these packages, run

mkdir -p $HOME/.local/share/argos-translate/packages
ln -sr packages/* $HOME/.local/share/argos-translate/packages

the files in packages/ are the result of installing the model files from the torrent
magnet:?xt=urn:btih:d1fb14d1b0f25e2e6f49d6dfd4ea761c445ad0d0&dn=Argos-Translate-LibreTranslate-2022-04-30
magnet:?xt=urn:btmh:12203d4464d5ccd13dfa5d1829f7c36f4b512c07e1d3086c1f7b9bb706864b82ef6f&dn=Argos-Translate-LibreTranslate-2022-04-30

#!/usr/bin/env python3
# install argos models to $HOME/.local/share/argos-translate/packages/
import argostranslate.package
import os
models_dir = os.environ["HOME"] + "/torrent/done/Argos-Translate-LibreTranslate-2022-04-30/models"
for name in os.listdir(models_dir):
    path = models_dir + "/" + name
    argostranslate.package.install_from_path(path)