calcpy commited on
Commit
7277829
·
verified ·
1 Parent(s): 4e8fdbe

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +98 -2
README.md CHANGED
@@ -8,10 +8,21 @@ tags:
8
  - trl
9
  license: apache-2.0
10
  language:
11
- - en
 
 
 
 
 
12
  ---
13
 
14
- # Uploaded model
 
 
 
 
 
 
15
 
16
  - **Developed by:** calcpy
17
  - **License:** apache-2.0
@@ -20,3 +31,88 @@ language:
20
  This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
21
 
22
  [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  - trl
9
  license: apache-2.0
10
  language:
11
+ - sw
12
+ library_name: peft
13
+ datasets:
14
+ - Mollel/alpaca-swahili
15
+ - Mollel/swahili_pretrain_data
16
+ - wikimedia/wikipedia
17
  ---
18
 
19
+ # Model Detauils
20
+
21
+
22
+ This model has been pre-trained and fine-tuned specifically for Swahili language tasks.
23
+ The training includes 4-bit quantization to optimize performance on lower-resource hardware.
24
+
25
+ This is a development version and it's not recommended for general use.
26
 
27
  - **Developed by:** calcpy
28
  - **License:** apache-2.0
 
31
  This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
32
 
33
  [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
34
+
35
+
36
+ ### Out-of-Scope Use
37
+
38
+ The model is not designed for tasks outside of the Swahili language or tasks requiring highly factual precision in domains not covered by the training datasets.
39
+
40
+
41
+ ## Bias, Risks, and Limitations
42
+
43
+ The model inherits any potential biases present in the Swahili Wikipedia and Mollel's dataset. Users should be cautious when applying this model to sensitive applications.
44
+
45
+
46
+ ### Recommendations
47
+
48
+ Users should perform bias evaluations specific to their use case and ensure that any downstream applications consider potential ethical implications.
49
+
50
+ ## How to Get Started with the Model
51
+
52
+ Use the code below to get started with the model.
53
+
54
+ ```python
55
+ from transformers import AutoModelForCausalLM, AutoTokenizer
56
+
57
+ # Load the model and tokenizer
58
+ model = AutoModelForCausalLM.from_pretrained("path_to_your_model")
59
+ tokenizer = AutoTokenizer.from_pretrained("path_to_your_model")
60
+
61
+ # Example inference
62
+ instruction = "Endelea mlolongo wa fibonacci:"
63
+ input_data = "1, 1, 2, 3, 5, 8,"
64
+ prompt = f"Chini ni maagizo ambayo yanaelezea kazi. Andika jibu ambalo linakamilisha ombi ipasavyo.\n### Maagizo:\n{instruction}\n\n{input_data}\n### Jibu:\n"
65
+
66
+ inputs = tokenizer([f"{prompt}"], return_tensors="pt").to("cuda")
67
+ outputs = model.generate(**inputs, max_new_tokens=64, use_cache=True)
68
+ print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
69
+ ```
70
+
71
+ In this example, the model generates the continuation of the Fibonacci sequence in Swahili.
72
+
73
+
74
+ ## Training Details
75
+
76
+ ### Training Data
77
+
78
+ The model was pre-trained using a combination of [Swahili Wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia)
79
+ and [Mollel’s Swahili pretraining dataset](https://huggingface.co/datasets/Mollel/swahili_pretrain_data).
80
+ Both datasets were processed to include End-of-Sequence (EOS) tokens and formatted for pretraining tasks.
81
+
82
+ Finetuning was performed on [Mollel's Alpaca dataset](https://huggingface.co/datasets/Mollel/alpaca-swahili)
83
+
84
+ ### Training Procedure
85
+
86
+ #### Training Hyperparameters
87
+
88
+ - ** Training regime: Mixed precision (fp16/bf16)
89
+ - ** Batch size: 2 per device
90
+ - ** Max steps: 24,000 for pretraining, 1,200 for fine-tuning
91
+ - ** Learning rate: 5e-5 (1e-5 for embeddings)
92
+ - ** Warmup steps: 100 for pretraining, 10 for fine-tuning
93
+ - ** Weight decay: 0.01 (pretraining), 0.00 (fine-tuning)
94
+
95
+ ## Evaluation
96
+
97
+ The model was only manually evaluated on the Alpaca Swahili dataset for instruction-following capabilities.
98
+
99
+ #### Metrics
100
+
101
+ Evaluation metrics will be required for language generation quality and instruction-following precision
102
+
103
+ #### Summary
104
+
105
+ This is a purely technical release for a small test model in order to test pre-training and fine-tuning code on a single GPU.
106
+
107
+
108
+ ## Environmental Impact
109
+
110
+ - **Hardware Type:** NVIDIA GeForce RTX 4090 24 GiB
111
+ - **Hours used:** ~12 hours
112
+
113
+
114
+ ### Compute Infrastructure
115
+
116
+ Ubuntu 22.04.5 LTS with multiple NVIDIA GeForce RTX 4090 cards
117
+
118
+ Only a single GPU unit was used