Spaces:
Running
Running
Create AGENTS.md
Browse files
AGENTS.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AGENTS.md — LibreTranslate Kabyle Space
|
| 2 |
+
|
| 3 |
+
## Overview
|
| 4 |
+
This Hugging Face Space hosts a LibreTranslate instance for **Kabyle (kab)** language translation.
|
| 5 |
+
It provides a self-hosted translation API with experimental Kabyle language models.
|
| 6 |
+
|
| 7 |
+
## Space Details
|
| 8 |
+
- **URL**: https://huggingface.co/spaces/boffire/libreTranslate_kabyle
|
| 9 |
+
- **Runtime**: Docker Space (LibreTranslate)
|
| 10 |
+
- **Languages**: Kabyle (kab) ↔ English
|
| 11 |
+
|
| 12 |
+
## API Endpoints
|
| 13 |
+
|
| 14 |
+
The LibreTranslate API is exposed at the Space's runtime URL:
|
| 15 |
+
```
|
| 16 |
+
https://boffire-libretranslate-kabyle.hf.space
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
### Key Endpoints
|
| 20 |
+
|
| 21 |
+
| Endpoint | Method | Description |
|
| 22 |
+
|----------|--------|-------------|
|
| 23 |
+
| `/translate` | POST | Translate text between languages |
|
| 24 |
+
| `/detect` | POST | Detect the language of given text |
|
| 25 |
+
| `/languages` | GET | List supported languages |
|
| 26 |
+
| `/suggest` | POST | Submit a translation suggestion |
|
| 27 |
+
|
| 28 |
+
### Authentication
|
| 29 |
+
- **Public access**: The API is publicly accessible when the Space is running
|
| 30 |
+
- **HF Token**: For private Spaces or higher rate limits, pass `Authorization: Bearer $HF_TOKEN`
|
| 31 |
+
|
| 32 |
+
### Example: Translate Text
|
| 33 |
+
```bash
|
| 34 |
+
curl -X POST https://boffire-libretranslate-kabyle.hf.space/translate \
|
| 35 |
+
-H "Content-Type: application/json" \
|
| 36 |
+
-d '{
|
| 37 |
+
"q": "Azul, amek i tettiliḍ?",
|
| 38 |
+
"source": "kab",
|
| 39 |
+
"target": "en"
|
| 40 |
+
}'
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
### Example: Detect Language
|
| 44 |
+
```bash
|
| 45 |
+
curl -X POST https://boffire-libretranslate-kabyle.hf.space/detect \
|
| 46 |
+
-H "Content-Type: application/json" \
|
| 47 |
+
-d '{
|
| 48 |
+
"q": "Azul, amek i tettiliḍ?"
|
| 49 |
+
}'
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
### Example: List Languages
|
| 53 |
+
```bash
|
| 54 |
+
curl https://boffire-libretranslate-kabyle.hf.space/languages
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Translation Models
|
| 58 |
+
The space runs experimental Kabyle models:
|
| 59 |
+
- Default is : kab
|
| 60 |
+
- Model: `Kabyle (OS)` — trained with OpenSubtitles backtranslation data
|
| 61 |
+
- Experimental variants: `kab_comp`, `kab_comp2`, `kab_all`, `kab_kab`
|
| 62 |
+
|
| 63 |
+
## Important Notes
|
| 64 |
+
- The Space may go to sleep after inactivity (cold start ~30s)
|
| 65 |
+
- Suggestions are stored in the dataset `boffire/libretranslate-en-kab-suggestions`
|
| 66 |
+
- Language codes use `kab` for standard Kabyle
|