BLOOM-560m β€” French β†’ Fang Translation

Fine-tuned version of bigscience/bloom-560m for translating French into Fang (a Bantu language spoken in Gabon, Equatorial Guinea, and Cameroon), using LoRA (Low-Rank Adaptation).

Usage

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

base = AutoModelForCausalLM.from_pretrained("bigscience/bloom-560m", dtype=torch.bfloat16)
model = PeftModel.from_pretrained(base, "vmombo/bloom-560m-fang-translation")
tokenizer = AutoTokenizer.from_pretrained("vmombo/bloom-560m-fang-translation")
model.eval()

prompt = "Traduis en fang: Bonjour, comment allez-vous ?\n\nFang:"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
    output = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(output[0], skip_special_tokens=True))

Prompt Format

Traduis en fang: <french sentence>

Fang: <fang translation>

Training Details

Parameter Value
Base model bigscience/bloom-560m
Method LoRA (r=16, alpha=32)
Target modules query_key_value
Trainable params 1,572,864 (0.28%)
Train samples 9,439
Eval samples 1,049
Epochs 5
Batch size 4 Γ— 4 grad accum
Learning rate 2e-4 (cosine)
Max length 256 tokens
Hardware Apple Silicon (MPS)

Training Objective

Only the Fang output tokens receive gradient signal β€” the French prompt is masked with labels=-100. This focuses 100% of learning on the target language rather than wasting capacity predicting French that BLOOM already knows.

Limitations

Fang is a very low-resource language. This model is an early-stage research prototype and may produce inaccurate translations. Contributions of additional Fang text data are welcome.

Author

Developed by vmombo.

Downloads last month
7
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for vmombo/bloom-560m-fang-translation

Adapter
(129)
this model