Spaces:
Running on Zero
Running on Zero
File size: 2,074 Bytes
88a619b d97df2b 777f0fa d97df2b 88a619b 36fc86c 88a619b 2f18d90 88a619b 36fc86c 88a619b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ---
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](https://huggingface.co/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.
This model was introduced in the paper
[*Optimizing T5 for Lightweight Tibetan-English Translation*](https://doi.org/10.21203/rs.3.rs-7409829/v1)
(Moore & Lauren, 2025); its training/evaluation code lives in
[optimizing-t5-tibetan-english-mt](https://github.com/billingsmoore/optimizing-t5-tibetan-english-mt).
## Setup
```bash
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`
|