Views
No views yet
tf2-4b is a parameter-efficiently fine-tuned checkpoint of Google Gemma 3 4 B that specialises in translating moral fables from English into Romanian.| Field | Value |
|---|---|
| Base model | google/gemma-3-4b-it |
| Architecture | Decoder-only Transformer · 3.88 B params |
| Fine-tuning method | Supervised SFT → instruction tuning → LoRA (r = 16) · adapters merged |
| Training data | 12 000 EN→RO fable pairs (train) + 1 500 val / 1 500 test (TinyFabulist-TF2) |
| Objective | Next-token cross-entropy on Romanian targets |
| Hardware / budget | TODO (e.g. 2 × A100 80 GB · ~ h · ≈ $) |
| Intended use | Offline literary translation of short stories / fables |
| Out-of-scope | News, legal, medical, or very long documents; languages other than EN ↔ RO |
| Context window | 8 192 tokens |
1from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
2
3model_id = "klusai/tf2-4b"
4
5tok = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
7
8translator = pipeline("text-generation", model=model, tokenizer=tok)
9
10en_fable = (
11 "Once upon a time, a small sparrow boasted to the mighty eagle that speed alone "
12 "was enough to conquer the sky. … Moral: Pride often blinds us to our limits."
13)
14
15ro_fable = translator(
16 f"Translate the following fable into Romanian:\n\n{en_fable}",
17 max_new_tokens=512,
18 temperature=0.2
19)[0]["generated_text"]
20
21print(ro_fable)| File | Precision | Size | Typical RAM |
|---|---|---|---|
tf2-4b-f16.safetensors | FP16 | 7.77 GB | ≥ 16 GB GPU / 20 GB CPU |
tf2-4b-q5_k_m.gguf | 5-bit Q5_K_M | 2.83 GB | ≥ 6 GB RAM |
1# Run the 5-bit build with llama-cpp-python
2pip install llama-cpp-python
3python -m llama_cpp.server \
4 --model tf2-4b-q5_k_m.gguf \
5 --n_ctx 8192