69 lines
1.7 KiB
Markdown
69 lines
1.7 KiB
Markdown
---
|
|
title: 73 install libretranslate
|
|
summary: >
|
|
Summarized how I finally got LibreTranslate installed on my local mastodon
|
|
test-instance. <small>I am not affiliated with LibreTranslate -- this post reflects
|
|
my own use case. The thumbnail is a trademark of
|
|
[LibreTranslate](https://github.com/LibreTranslate/LibreTranslate/blob/main/TRADEMARK.md).</small>
|
|
date: 2024-12-07T07:22:28+01:00
|
|
lastmod: 2024-12-08T11:14:36+0000
|
|
categories:
|
|
- amateur-radio
|
|
- computerstuff
|
|
tags:
|
|
- draft_post
|
|
|
|
# showBreadcrumbs: true
|
|
# showDate: false
|
|
# showReadingTime: false
|
|
# showWordCount: false
|
|
# showPagination: false
|
|
|
|
# feed_exclude: true
|
|
# site_exclude: true
|
|
|
|
# some help
|
|
#
|
|
# highlighting with highlights
|
|
#
|
|
# use table, as inline creates a padding around
|
|
# and it pushes the text more to the right side (end of screen)
|
|
#
|
|
# ~~~html {linenos=table,hl_lines="3-6"}
|
|
# ~~~html {linenos=inline,hl_lines="1,3-6"}
|
|
|
|
draft: true
|
|
---
|
|
|
|
upgraded VM to 4 cores and 8GB RAM
|
|
|
|
(also had to increase /tmp folder for pip installation of libretranslate:
|
|
|
|
tmpfs /tmp tmpfs size=6G,nr_inodes=10k 0 0)
|
|
|
|
sudo useradd --create-home --home-dir /var/lib/libretranslate libretranslate
|
|
|
|
paru -S python-libretranslate-git cmake
|
|
|
|
sudo su - libretranslate
|
|
|
|
python -m venv venv
|
|
|
|
source venv/bin/activate
|
|
|
|
pip3 install --prefer-binary libretranslate
|
|
|
|
argospm update
|
|
|
|
for lang in $(argospm search | grep -E "^translate-.._en.*"| awk '{ print $2 }' | xargs); do echo argospm install translate-${lang}\_en; done
|
|
|
|
(remove echo from command to finally execute; the command shows a list of install commands)
|
|
|
|
now edit mastodon conf to use libretranslate
|
|
|
|
cd /var/lib/mastodon
|
|
|
|
add to .env.production
|
|
|
|
ALLOWED_PRIVATE_ADDRESSES=127.0.0.1
|
|
LIBRE_TRANSLATE_ENDPOINT=http://127.0.0.1:5000
|