Update README.md
Browse files
README.md
CHANGED
|
@@ -10,12 +10,87 @@ language:
|
|
| 10 |
- en
|
| 11 |
---
|
| 12 |
|
| 13 |
-
#
|
| 14 |
|
| 15 |
-
-
|
| 16 |
-
- **License:** apache-2.0
|
| 17 |
-
- **Finetuned from model :** unsloth/llama-3.2-1b-instruct-unsloth-bnb-4bit
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
- en
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Opani Coder 1B (16-bit)
|
| 14 |
|
| 15 |
+
A fine-tuned Llama 3.2 1B model for coding assistance in Twi (Akan language), helping Twi speakers learn programming in their native language.
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
## Model Details
|
| 18 |
|
| 19 |
+
- **Base Model**: Llama 3.2 1B
|
| 20 |
+
- **Precision**: 16-bit full model
|
| 21 |
+
- **Language**: Twi with code examples
|
| 22 |
+
- **Fine-tuning**: Full model fine-tuning
|
| 23 |
+
- **Developed by**: michsethowusu
|
| 24 |
+
|
| 25 |
+
## Installation
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
pip install torch transformers
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
## Usage
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
|
| 35 |
+
import torch
|
| 36 |
+
|
| 37 |
+
# Load model
|
| 38 |
+
model_id = "michsethowusu/opani-coder_1b-merged-16bit"
|
| 39 |
+
|
| 40 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 41 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 42 |
+
model_id,
|
| 43 |
+
torch_dtype=torch.float16,
|
| 44 |
+
device_map="auto",
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
# Prepare message
|
| 48 |
+
messages = [
|
| 49 |
+
{"role": "user", "content": "Kyerɛkyerɛ nea for loop yɛ"}
|
| 50 |
+
]
|
| 51 |
+
|
| 52 |
+
text = tokenizer.apply_chat_template(
|
| 53 |
+
messages,
|
| 54 |
+
tokenize=False,
|
| 55 |
+
add_generation_prompt=True,
|
| 56 |
+
)
|
| 57 |
+
|
| 58 |
+
# Generate response
|
| 59 |
+
streamer = TextStreamer(tokenizer, skip_prompt=True)
|
| 60 |
+
_ = model.generate(
|
| 61 |
+
**tokenizer(text, return_tensors="pt").to(model.device),
|
| 62 |
+
max_new_tokens=512,
|
| 63 |
+
temperature=0.7,
|
| 64 |
+
top_p=0.9,
|
| 65 |
+
streamer=streamer,
|
| 66 |
+
)
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
## Use Cases
|
| 70 |
+
|
| 71 |
+
- Explaining programming concepts in Twi
|
| 72 |
+
- Code generation with Twi commentary
|
| 73 |
+
- Debugging assistance in Twi
|
| 74 |
+
- Translating coding tutorials to Twi
|
| 75 |
+
|
| 76 |
+
## Limitations
|
| 77 |
+
|
| 78 |
+
- Optimized for Twi language programming interactions
|
| 79 |
+
- May mix English technical terms
|
| 80 |
+
- Verify generated code before production use
|
| 81 |
+
|
| 82 |
+
## Citation
|
| 83 |
+
|
| 84 |
+
```bibtex
|
| 85 |
+
@misc{opani-coder_1b_2024,
|
| 86 |
+
author = {michsethowusu},
|
| 87 |
+
title = {Opani Coder 1B: Fine-tuned Llama 3.2 1B for Twi Coding Assistance},
|
| 88 |
+
year = {2024},
|
| 89 |
+
publisher = {HuggingFace},
|
| 90 |
+
url = {https://huggingface.co/michsethowusu/opani-coder_1b-merged-16bit}
|
| 91 |
+
}
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
## Contact
|
| 95 |
+
|
| 96 |
+
- HuggingFace: @michsethowusu
|