File size: 1,035 Bytes
701dbf1
162d5b7
ce82694
1900a95
6536f1c
701dbf1
edb8657
701dbf1
2ba774e
701dbf1
 
59c1004
701dbf1
 
162d5b7
177f899
59c1004
177f899
 
 
03230b5
177f899
2cbad7c
177f899
 
 
 
03230b5
 
2ba774e
ff2b232
177f899
 
 
 
 
 
 
ff2b232
 
 
fe1383b
 
177f899
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
---
title: MADLAD-400 Translate
emoji: 🌍
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 6.17.3
app_file: app.py
python_version: "3.12"
pinned: false
license: apache-2.0
short_description: Translate between 418 languages.
---

# MADLAD-400 Translate

Translate between 418 languages from Table 9 (Section A.1) of Google's [MADLAD-400](https://arxiv.org/pdf/2309.04662) 3B model.

## Requirements

- [uv](https://docs.astral.sh/uv/) (Python package manager)
- Python 3.12
- CUDA GPU (recommended) or CPU

## Setup

```bash
uv venv --python 3.12
uv pip install -r requirements.txt
uv pip install -r requirements-dev.txt   # local runtime (gradio, spaces) + dev tools
uv run app.py
```

The Gradio interface launches at `http://localhost:7860`.

## Tooling

```bash
uv run ruff check .             # lint
uv run ruff format .            # format
uv run ty check                 # type check
uv run pytest -m "not slow"     # 71 fast tests
uv run pytest                   # all 81 tests (slow require CUDA + model download)
```