Skip to main content

retico-hftranslate

A local translation module based on the hugging face transformer library within the ReTico framework.

Installation and Requirements

To use the translation module you first need to install the retico-core package:

  • Install retico_core: pip install git+https://github.com/retico-team/retico-core.git

Right after that, install the hftranslate package:

  • Install the retico-hftranslate: pip install git+https://github.com/retico-team/retico-hftranslate.git

Modules

HFTranslateModule

Incrementally translate text from one language to another using HuggingFace's pipeline with Helsinki-NLP models.

Language options: en (English), fr (French), de (German), es (Spanish)

Arguments:

  • from_lang (str): Source language to use, defaults to 'en'
  • to_lang (str): Target language to use, defaults to 'de'

Example

from retico_core import *
import retico_wav2vecasr
import retico_speechbraintts
import retico_hftranslate

msg = []


def callback(update_msg):
    global msg
    for x, ut in update_msg:
        if ut == UpdateType.ADD:
            msg.append(x)
        if ut == UpdateType.REVOKE:
            msg.remove(x)
    txt = ""
    committed = False
    for x in msg:
        txt += x.text + " "
        committed = committed or x.committed
    print(" " * 80, end="\r")
    print(f"{txt}", end="\r")
    if committed:
        msg = []
        print("")


m1 = audio.MicrophoneModule()
m2 = retico_wav2vecasr.Wav2VecASRModule(language="de")
m3 = retico_hftranslate.HFTranslateModule(from_lang="de", to_lang="en")
m5 = retico_speechbraintts.SpeechBrainTTSModule(language="en")
m6 = audio.SpeakerModule(rate=22050)
m4 = debug.CallbackModule(callback)

m1.subscribe(m2)
m2.subscribe(m3)
m3.subscribe(m4)
m3.subscribe(m5)
m5.subscribe(m6)

network.run(m1)

print("Press any key to exit")
input()

network.stop(m1)

Metadata

Release files for retico-hftranslate 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for retico-hftranslate 0.2.2
File Size Uploaded
retico_hftranslate-0.2.2.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for retico-hftranslate 0.2.2
File Interpreter ABI Platform
retico_hftranslate-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 26.2 kB

Release files / retico_hftranslate-0.2.2.tar.gz

Download URL retico_hftranslate-0.2.2.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5d85e47242f3dfeec3d067c690e540e325fa8acf6e80fe08849872e987b939a8
BLAKE2b-256 checksum
How to use checksums
6a234030cbc33d4d6dafe59a2a023e0f85f2cad72a9745e67e2378182dd3fe2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / retico_hftranslate-0.2.2-py3-none-any.whl

Download URL retico_hftranslate-0.2.2-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce62adc6f5721815aa34e84f6b31105a57a9c07e5d5f1720e09d5ded73ba0b2a
BLAKE2b-256 checksum
How to use checksums
c8194fba561a0df142ed5cfecdebcef494cccdaa89c1848e2ba93e558322174a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page