初始化项目,由ModelHub XC社区提供模型
Model: ghananlpcommunity/kasawa Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
69
README.md
Normal file
69
README.md
Normal file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
library_name: transformers
|
||||
license: cc-by-4.0
|
||||
datasets:
|
||||
- ghananlpcommunity/pristine-twi
|
||||
language:
|
||||
- tw
|
||||
- ak
|
||||
base_model:
|
||||
- HuggingFaceTB/SmolLM2-135M
|
||||
---
|
||||
# Kasawa — SmolLM2-135M Fine-tuned on Twi
|
||||
|
||||
**kasawa** is a compact Twi language model capable of generating coherent twi text as casual language model. It should be noted that this model serves as a base model and it has not undergone intruction tuning.
|
||||
|
||||
Built on [SmolLM2-135M](https://huggingface.co/HuggingFaceTB/SmolLM2-135M) and
|
||||
trained on the [Pristine Twi Dataset](https://huggingface.co/datasets/ghananlpcommunity/pristine-twi)
|
||||
— ~999k rows of clean, naturally sounding Twi text spanning four styles:
|
||||
narrative, dialogue, monologue, and storytelling, grounded in real Ghanaian
|
||||
news topics and named entities.
|
||||
|
||||
Try it the yourself in the [demo](https://huggingface.co/spaces/ghananlpcommunity/kasawa).
|
||||
|
||||
## Intended Use
|
||||
|
||||
This model is released for **research and non-profit use only**. The primary goal
|
||||
is to lower the barrier for experimentation in the Twi/Akan NLP space —
|
||||
particularly as a base for instruction-tuned models targeting more advanced tasks
|
||||
such as summarization, question answering, and dialogue in Twi.
|
||||
|
||||
It can also be very useful as a backbone for LLM-based **text-to-speech (TTS)** and **automatic
|
||||
speech recognition (ASR)** systems, as well as **machine translation (MT)** models
|
||||
involving Twi.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```python
|
||||
import torch
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained(
|
||||
"ghananlpcommunity/kasawa",
|
||||
torch_dtype=torch.bfloat16,
|
||||
device_map="auto"
|
||||
)
|
||||
tokenizer = AutoTokenizer.from_pretrained("ghananlpcommunity/kasawa")
|
||||
gen = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
||||
|
||||
prompt = "Ɔpɛnimaa bosome, 2025,"
|
||||
out = gen(prompt, max_new_tokens=200, do_sample=True, temperature=0.65, top_p=0.9)
|
||||
print(out[0]["generated_text"])
|
||||
```
|
||||
|
||||
## Training Details
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Base model | SmolLM2-135M |
|
||||
| Dataset | Pristine Twi (~999k rows, ~250M tokens) |
|
||||
| Epochs | ~2 |
|
||||
| Hardware | 1× 80GB GPU |
|
||||
|
||||
## Citation & Community
|
||||
|
||||
Created by **Mich-Seth Owusu** for the [Ghana NLP Community](https://huggingface.co/ghananlpcommunity).
|
||||
If you build on this model, please credit the original work and consider sharing
|
||||
your results back with the community.
|
||||
|
||||
**License:** Research and non-profit use only.
|
||||
34
config.json
Normal file
34
config.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"architectures": [
|
||||
"LlamaForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 0,
|
||||
"dtype": "bfloat16",
|
||||
"eos_token_id": 0,
|
||||
"head_dim": 64,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 576,
|
||||
"initializer_range": 0.041666666666666664,
|
||||
"intermediate_size": 1536,
|
||||
"is_llama_config": true,
|
||||
"max_position_embeddings": 8192,
|
||||
"mlp_bias": false,
|
||||
"model_type": "llama",
|
||||
"num_attention_heads": 9,
|
||||
"num_hidden_layers": 30,
|
||||
"num_key_value_heads": 3,
|
||||
"pad_token_id": 0,
|
||||
"pretraining_tp": 1,
|
||||
"rms_norm_eps": 1e-05,
|
||||
"rope_interleaved": false,
|
||||
"rope_parameters": {
|
||||
"rope_theta": 100000,
|
||||
"rope_type": "default"
|
||||
},
|
||||
"tie_word_embeddings": true,
|
||||
"transformers_version": "5.6.2",
|
||||
"use_cache": false,
|
||||
"vocab_size": 49152
|
||||
}
|
||||
9
generation_config.json
Normal file
9
generation_config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 0,
|
||||
"eos_token_id": [
|
||||
0
|
||||
],
|
||||
"pad_token_id": 0,
|
||||
"transformers_version": "5.6.2"
|
||||
}
|
||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7c7cbd777e84eb64ed0cc624290df1b575ee8423c457d01665a85b99f02b591a
|
||||
size 269060552
|
||||
244965
tokenizer.json
Normal file
244965
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
34
tokenizer_config.json
Normal file
34
tokenizer_config.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"add_prefix_space": false,
|
||||
"backend": "tokenizers",
|
||||
"bos_token": "<|endoftext|>",
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "<|endoftext|>",
|
||||
"errors": "replace",
|
||||
"extra_special_tokens": [
|
||||
"<|endoftext|>",
|
||||
"<|im_start|>",
|
||||
"<|im_end|>",
|
||||
"<repo_name>",
|
||||
"<reponame>",
|
||||
"<file_sep>",
|
||||
"<filename>",
|
||||
"<gh_stars>",
|
||||
"<issue_start>",
|
||||
"<issue_comment>",
|
||||
"<issue_closed>",
|
||||
"<jupyter_start>",
|
||||
"<jupyter_text>",
|
||||
"<jupyter_code>",
|
||||
"<jupyter_output>",
|
||||
"<jupyter_script>",
|
||||
"<empty_output>"
|
||||
],
|
||||
"is_local": false,
|
||||
"local_files_only": false,
|
||||
"model_max_length": 8192,
|
||||
"pad_token": "<|endoftext|>",
|
||||
"tokenizer_class": "GPT2Tokenizer",
|
||||
"unk_token": "<|endoftext|>",
|
||||
"vocab_size": 49152
|
||||
}
|
||||
Reference in New Issue
Block a user