SimpleTranslationUI / README.md
billingsmoore's picture
Switch translation backend from Gemini to OpenRouter, add test suite
36fc86c
|
Raw
History Blame
1.75 kB
metadata
title: SimpleTranslationUI
emoji: πŸ“œ
colorFrom: yellow
colorTo: red
sdk: gradio
sdk_version: 6.20.0
python_version: '3.12'
app_file: app.py
pinned: false

SimpleTranslationUI

A stripped-down Tibetan Buddhist translation editor. Upload a .txt, .docx, or .pdf file β€” it's automatically split into segments, translated, and editable before download.

No video/audio, no subtitle timing, no multi-language prompts, no saved projects β€” just upload, translate, edit, download.

Translation backend

  • If you provide an OpenRouter API key (in the UI, or via an OPENROUTER_API_KEY env var / .env file), translation uses whichever OpenRouter model you pick from the Settings dropdown (live-fetched from OpenRouter's catalog, with a few recommended models pinned to the top), with the editable prompt in the Settings panel (translation_prompt.txt).
  • Otherwise it falls back to a local CPU model, billingsmoore/mlotsawa-ground-base, loaded via transformers. The prompt box has no effect on this backend β€” it's a plain seq2seq translation model, not an instruction-following LLM. First use downloads the model (a few hundred MB) and is slow; keep it running.

Setup

pip install -r requirements.txt
python app.py

Optionally set OPENROUTER_API_KEY in a .env file to default to OpenRouter without typing a key into the UI each time.

Downloads

After translating, Download offers whichever of these have content:

  • Translation as .txt
  • Translation as .docx
  • .json (source + target per segment β€” re-upload via "Resume" to merge translations back in if you re-upload the same source file)
  • Source text as .txt