File size: 1,471 Bytes
6140689
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
base_model: google/gemma-4-E4B-it
library_name: peft
pipeline_tag: text-generation
license: apache-2.0
datasets:
- africatic/afritemp-bench
tags:
- base_model:adapter:google/gemma-4-E4B-it
- lora
- sft
- transformers
- trl
---

# Gemma 4 E4B — AfriTemp LoRA

This repository contains a LoRA adapter fine-tuned from
[`google/gemma-4-E4B-it`](https://huggingface.co/google/gemma-4-E4B-it) on
[`africatic/afritemp-bench`](https://huggingface.co/datasets/africatic/afritemp-bench).

## Training setup

- Method: LoRA supervised fine-tuning
- Precision: BF16
- GPU: NVIDIA A100-SXM4-40GB
- Maximum sequence length: 1024
- Epochs: 3
- Per-device batch size: 1
- Gradient accumulation: 16
- Effective batch size: 16
- Learning rate: 0.0002
- LoRA rank: 16
- LoRA alpha: 32

## Intended use

The adapter is intended for research on temporal reasoning and African
economic, social and development data. It should be evaluated carefully before
use in consequential decision-making.

## Loading

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

base_model_id = "google/gemma-4-E4B-it"
adapter_id = "YOUR_HF_USERNAME/gemma-4-e4b-afritemp"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    dtype=torch.bfloat16,
    device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)
```
### Framework versions

- PEFT 0.19.1