ciskoM commited on
Commit
66c11fa
·
verified ·
1 Parent(s): 375cd93

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +104 -0
README.md ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ language:
4
+ - wo
5
+ - fr
6
+ - en
7
+ base_model: Qwen/Qwen2.5-1.5B-Instruct
8
+ pipeline_tag: text-generation
9
+ library_name: transformers
10
+ tags:
11
+ - wolof
12
+ - senegal
13
+ - translation
14
+ - low-resource
15
+ - qwen2.5
16
+ - unsloth
17
+ - lora
18
+ ---
19
+
20
+ # Wolof Qwen2.5-1.5B — conversational + translation (wo · fr · en)
21
+
22
+ A fine-tune of **Qwen2.5-1.5B-Instruct** for the **Wolof** language. It can hold a
23
+ chat conversation and translate between **Wolof ↔ French ↔ English**.
24
+
25
+ Trained with [Unsloth](https://github.com/unslothai/unsloth) (QLoRA, 4-bit) on a
26
+ single GPU.
27
+
28
+ ## Intended use
29
+
30
+ - Wolof ⇄ French ⇄ English translation inside a chat interface
31
+ - Experiments and research on low-resource (Wolof) language modelling
32
+ - A base to iterate on with more conversational Wolof data
33
+
34
+ ## How to use
35
+
36
+ **Transformers**
37
+ ```python
38
+ from transformers import AutoModelForCausalLM, AutoTokenizer
39
+
40
+ tok = AutoTokenizer.from_pretrained("ciskoM/wolof-qwen-1.5b")
41
+ model = AutoModelForCausalLM.from_pretrained("ciskoM/wolof-qwen-1.5b", device_map="auto")
42
+
43
+ msgs = [{"role": "user", "content": "Translate to Wolof: Good morning, how are you?"}]
44
+ ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
45
+ print(tok.decode(model.generate(ids, max_new_tokens=64)[0], skip_special_tokens=True))
46
+ ```
47
+
48
+ **GGUF (Ollama / LM Studio / llama.cpp)** — see the companion repo
49
+ `ciskoM/wolof-qwen-1.5b-gguf` (q4_k_m). With Ollama:
50
+ ```bash
51
+ ollama create wolof -f Modelfile # Modelfile: FROM ./wolof-qwen.Q4_K_M.gguf
52
+ ollama run wolof
53
+ ```
54
+
55
+ Example prompts: `Translate to Wolof: …`, `Traduis en wolof : …`,
56
+ `What does "Jamm rekk" mean in English?`, `Nanga def?`
57
+
58
+ ## Training data
59
+
60
+ ~120k instruction pairs (ShareGPT format), balanced across translation
61
+ directions plus monolingual Wolof:
62
+
63
+ | Source | Content |
64
+ |---|---|
65
+ | `bilalfaye/english-wolof-french-translation` | aligned en/wo/fr sentences |
66
+ | `galsenai/centralized_wolof_french_translation_data` | aligned wo/fr sentences |
67
+ | ALMA / DLIR Wolof e-books (13) | OCR'd authentic Wolof prose |
68
+ | wolofresources.org PDFs + UDHR Wolof | proverbs, tales, vocabulary |
69
+ | Wolof New Testament (bibliamundi) | clean verse-numbered scripture |
70
+
71
+ The dataset is ~96% translation pairs; bidirectional pairs (en2wo, wo2en,
72
+ fr2wo, wo2fr) were generated with varied prompt templates.
73
+
74
+ ## Training procedure
75
+
76
+ - Base: `Qwen/Qwen2.5-1.5B-Instruct`, loaded 4-bit
77
+ - LoRA: r=16, alpha=16, dropout=0, on all attention + MLP projections
78
+ - 1 epoch, lr 2e-4, linear schedule, adamw_8bit, seq len 2048
79
+ - Trained on assistant responses only (`train_on_responses_only`)
80
+ - Tooling: Unsloth + TRL `SFTTrainer`/`SFTConfig`
81
+
82
+ ## Limitations & honest caveats
83
+
84
+ - **Translation > conversation.** Because the data is overwhelmingly translation
85
+ pairs, the model is strong at translating but **limited at free-flowing Wolof
86
+ conversation**. More conversational Wolof data is the fix, not a bigger model.
87
+ - Wolof is low-resource; expect errors, especially on rare topics, long inputs,
88
+ and Wolof orthography variants.
89
+ - Some training text came from OCR (scanned PDFs) and subtitle-sourced corpora —
90
+ there may be noise, odd register, or artifacts.
91
+ - Not safety-tuned; do not use for high-stakes decisions.
92
+
93
+ ## Data & licensing note
94
+
95
+ Model weights derive from Qwen2.5 (Apache-2.0). However, the **training data
96
+ provenance is mixed**: the translation corpora are subtitle/film-sourced and the
97
+ scripture is from a translation that may carry its own copyright. This card is
98
+ released **CC-BY-NC-4.0** as a conservative default. **Verify the licenses of the
99
+ underlying datasets before any commercial use or redistribution.**
100
+
101
+ ## Acknowledgements
102
+
103
+ Datasets by bilalfaye and the GalsenAI community; ALMA/DLIR African Language
104
+ Materials Archive; wolofresources.org; Biblia Mundi. Built with Unsloth.