Upload InkubaLM-0.4B.Q4_K_S.gguf with huggingface_hub
This commit is contained in:
39
.gitattributes
vendored
39
.gitattributes
vendored
@@ -1,38 +1,49 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin 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
|
||||
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
||||
*.tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
*.db* filter=lfs diff=lfs merge=lfs -text
|
||||
*.ark* filter=lfs diff=lfs merge=lfs -text
|
||||
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
|
||||
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
|
||||
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.gguf* filter=lfs diff=lfs merge=lfs -text
|
||||
*.ggml filter=lfs diff=lfs merge=lfs -text
|
||||
*.llamafile* filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q5_1.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
InkubaLM-0.4B.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
3
InkubaLM-0.4B.Q2_K.gguf
Normal file
3
InkubaLM-0.4B.Q2_K.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0465e16af6ca05b844673f7c67e40f295a8bca884012c9ccd0943485285555a5
|
||||
size 297953920
|
||||
3
InkubaLM-0.4B.Q3_K_L.gguf
Normal file
3
InkubaLM-0.4B.Q3_K_L.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1680f99ce9a6ab322be2af09a39585de3dd3bcc79dfc571326bcb36907f8ed9c
|
||||
size 377455936
|
||||
3
InkubaLM-0.4B.Q3_K_M.gguf
Normal file
3
InkubaLM-0.4B.Q3_K_M.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d246a26a13dba15d098184de0b8d3114441f7011bafce1333af8664f15736da6
|
||||
size 358581568
|
||||
3
InkubaLM-0.4B.Q3_K_S.gguf
Normal file
3
InkubaLM-0.4B.Q3_K_S.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0051bce2a1e9e5aa1b3a166ed9f5012c355c4f5e8e493109b54735fc6c70e8f5
|
||||
size 336364864
|
||||
3
InkubaLM-0.4B.Q4_0.gguf
Normal file
3
InkubaLM-0.4B.Q4_0.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d9e25046268d10e8cca4b211778c89dcddcd8b3dc3ed7b5049ab8d7fe22161e5
|
||||
size 407762688
|
||||
3
InkubaLM-0.4B.Q4_1.gguf
Normal file
3
InkubaLM-0.4B.Q4_1.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5b252adbcafad23f7815c4252445f8a02fbb312a8a63a2a239aae815e6252d5f
|
||||
size 441361664
|
||||
3
InkubaLM-0.4B.Q4_K_M.gguf
Normal file
3
InkubaLM-0.4B.Q4_K_M.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2ac27b44012a085baa6b51f174ffdb6d2935e9dca74736eb2d4eefa9b3d3a1aa
|
||||
size 423982848
|
||||
3
InkubaLM-0.4B.Q4_K_S.gguf
Normal file
3
InkubaLM-0.4B.Q4_K_S.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c743681f6651bc2053b5081bac3e872be41d922a83605a5599e8b6c9cf020c9c
|
||||
size 411301632
|
||||
3
InkubaLM-0.4B.Q5_0.gguf
Normal file
3
InkubaLM-0.4B.Q5_0.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:91943953739d4973b8abf3593f3f248d5a792de112b5c685587b0b98171f0347
|
||||
size 474960640
|
||||
3
InkubaLM-0.4B.Q5_1.gguf
Normal file
3
InkubaLM-0.4B.Q5_1.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:57fddedf4d736487e5cc524e97aeb8bc2182f620cbfb2eda9a527a08cfd7158b
|
||||
size 508559616
|
||||
3
InkubaLM-0.4B.Q5_K_M.gguf
Normal file
3
InkubaLM-0.4B.Q5_K_M.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1da556816b3287437aa126751fe805e1a472f51f79b66d8ef536c24101d67ad4
|
||||
size 483316480
|
||||
3
InkubaLM-0.4B.Q5_K_S.gguf
Normal file
3
InkubaLM-0.4B.Q5_K_S.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5eb046b90a3b207402f3b1d4a722ba8ec7f22bc6aea62d54bd718161f796c8d2
|
||||
size 474960640
|
||||
3
InkubaLM-0.4B.Q6_K.gguf
Normal file
3
InkubaLM-0.4B.Q6_K.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f0099416d4c7d7d93475762635d6f15d96e45bf2a83b7a52df88ab9379a7c0f5
|
||||
size 546358464
|
||||
3
InkubaLM-0.4B.Q8_0.gguf
Normal file
3
InkubaLM-0.4B.Q8_0.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7f2b692c02e60de4fd746e3e8f281a048d2a55fa19d78e90494aca5147315fc9
|
||||
size 707201344
|
||||
203
README.md
203
README.md
@@ -1,47 +1,178 @@
|
||||
|
||||
---
|
||||
license: Apache License 2.0
|
||||
|
||||
#model-type:
|
||||
##如 gpt、phi、llama、chatglm、baichuan 等
|
||||
#- gpt
|
||||
language:
|
||||
- en
|
||||
- sw
|
||||
- zu
|
||||
- xh
|
||||
- ha
|
||||
- yo
|
||||
pipeline_tag: text-generation
|
||||
tags:
|
||||
- nlp
|
||||
- InkubaLM
|
||||
- africanLLM
|
||||
- africa
|
||||
- llm
|
||||
datasets:
|
||||
- lelapa/Inkuba-Mono
|
||||
license: cc-by-nc-4.0
|
||||
|
||||
#domain:
|
||||
##如 nlp、cv、audio、multi-modal
|
||||
#- nlp
|
||||
|
||||
#language:
|
||||
##语言代码列表 https://help.aliyun.com/document_detail/215387.html?spm=a2c4g.11186623.0.0.9f8d7467kni6Aa
|
||||
#- cn
|
||||
|
||||
#metrics:
|
||||
##如 CIDEr、Blue、ROUGE 等
|
||||
#- CIDEr
|
||||
|
||||
#tags:
|
||||
##各种自定义,包括 pretrained、fine-tuned、instruction-tuned、RL-tuned 等训练方法和其他
|
||||
#- pretrained
|
||||
|
||||
#tools:
|
||||
##如 vllm、fastchat、llamacpp、AdaSeq 等
|
||||
#- vllm
|
||||
---
|
||||
### 当前模型的贡献者未提供更加详细的模型介绍。模型文件和权重,可浏览“模型文件”页面获取。
|
||||
#### 您可以通过如下git clone命令,或者ModelScope SDK来下载模型
|
||||
|
||||
SDK下载
|
||||
```bash
|
||||
#安装ModelScope
|
||||
pip install modelscope
|
||||

|
||||
|
||||
# QuantFactory/InkubaLM-0.4B-GGUF
|
||||
This is quantized version of [lelapa/InkubaLM-0.4B](https://huggingface.co/lelapa/InkubaLM-0.4B) created using llama.cpp
|
||||
|
||||
# Original Model Card
|
||||
|
||||
# InkubaLM-0.4B: Small language model for low-resource African Languages
|
||||
|
||||
<!-- Provide a quick summary of what the model is/does. -->
|
||||
|
||||
|
||||

|
||||
|
||||
## Model Details
|
||||
InkubaLM has been trained from scratch using 1.9 billion tokens of data for five African languages, along with English and French data, totaling 2.4 billion tokens of data.
|
||||
Similar to the model architecture used for MobileLLM, we trained this InkubaLM with a parameter size of 0.4 billion and a vocabulary size of 61788.
|
||||
For detailed information on training, benchmarks, and performance, please refer to our full [blog post](https://medium.com/@lelapa_ai/inkubalm-a-small-language-model-for-low-resource-african-languages-dc9793842dec).
|
||||
### Model Description
|
||||
|
||||
<!-- Provide a longer summary of what this model is. -->
|
||||
|
||||
|
||||
|
||||
- **Developed by:** [Lelapa AI](https://lelapa.ai/) - Fundamental Research Team.
|
||||
- **Model type:** Small Language Model (SLM) for five African languages built using the architecture design of LLaMA-7B.
|
||||
- **Language(s) (NLP):** isiZulu, Yoruba, Swahili, isiXhosa, Hausa, English and French.
|
||||
- **License:** CC BY-NC 4.0.
|
||||
|
||||
### Model Sources
|
||||
|
||||
<!-- Provide the basic links for the model. -->
|
||||
|
||||
- **Repository:** TBD
|
||||
- **Paper :** [InkubaLM](https://arxiv.org/pdf/2408.17024)
|
||||
|
||||
|
||||
## How to Get Started with the Model
|
||||
|
||||
Use the code below to get started with the model.
|
||||
|
||||
``` python
|
||||
pip install transformers
|
||||
|
||||
```
|
||||
# Running the model on CPU/GPU/multi GPU
|
||||
## - Running the model on CPU
|
||||
``` Python
|
||||
from transformers import AutoTokenizer, AutoModelForCausalLM
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained("lelapa/InkubaLM-0.4B",trust_remote_code=True)
|
||||
model = AutoModelForCausalLM.from_pretrained("lelapa/InkubaLM-0.4B",trust_remote_code=True)
|
||||
|
||||
text = "Today I planned to"
|
||||
inputs = tokenizer(text, return_tensors="pt")
|
||||
input_ids = inputs.input_ids
|
||||
|
||||
# Create an attention mask
|
||||
attention_mask = inputs.attention_mask
|
||||
|
||||
# Generate outputs using the attention mask
|
||||
outputs = model.generate(input_ids, attention_mask=attention_mask, max_length=60,pad_token_id=tokenizer.eos_token_id)
|
||||
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
||||
|
||||
```
|
||||
## - Using full precision
|
||||
```python
|
||||
#SDK模型下载
|
||||
from modelscope import snapshot_download
|
||||
model_dir = snapshot_download('QuantFactory/InkubaLM-0.4B-GGUF')
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained("lelapa/InkubaLM-0.4B", trust_remote_code=True)
|
||||
tokenizer = AutoTokenizer.from_pretrained("lelapa/InkubaLM-0.4B", trust_remote_code=True)
|
||||
|
||||
model.to('cuda')
|
||||
text = "Today i planned to "
|
||||
input_ids = tokenizer(text, return_tensors="pt").to('cuda').input_ids
|
||||
outputs = model.generate(input_ids, max_length=1000, repetition_penalty=1.2, pad_token_id=tokenizer.eos_token_id)
|
||||
print(tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1])[0].strip())
|
||||
|
||||
```
|
||||
Git下载
|
||||
## - Using torch.bfloat16
|
||||
``` python
|
||||
import torch
|
||||
from transformers import AutoTokenizer, AutoModelForCausalLM
|
||||
checkpoint = "lelapa/InkubaLM-0.4B"
|
||||
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto",torch_dtype=torch.bfloat16, trust_remote_code=True)
|
||||
inputs = tokenizer.encode("Today i planned to ", return_tensors="pt").to("cuda")
|
||||
outputs = model.generate(inputs)
|
||||
print(tokenizer.decode(outputs[0]))
|
||||
|
||||
```
|
||||
#Git模型下载
|
||||
git clone https://www.modelscope.cn/QuantFactory/InkubaLM-0.4B-GGUF.git
|
||||
## - Using quantized Versions via bitsandbytes
|
||||
|
||||
``` python
|
||||
pip install bitsandbytes accelerate
|
||||
```
|
||||
``` python
|
||||
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
||||
quantization_config = BitsAndBytesConfig(load_in_8bit=True) # to use 4bit use `load_in_4bit=True` instead
|
||||
checkpoint = "lelapa/InkubaLM-0.4B"
|
||||
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
||||
model = AutoModelForCausalLM.from_pretrained(checkpoint, quantization_config=quantization_config, trust_remote_code=True)
|
||||
inputs = tokenizer.encode("Today i planned to ", return_tensors="pt").to("cuda")
|
||||
outputs = model.generate(inputs)
|
||||
print(tokenizer.decode(outputs[0]))
|
||||
|
||||
```
|
||||
|
||||
<p style="color: lightgrey;">如果您是本模型的贡献者,我们邀请您根据<a href="https://modelscope.cn/docs/ModelScope%E6%A8%A1%E5%9E%8B%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B%E6%A6%82%E8%A7%88" style="color: lightgrey; text-decoration: underline;">模型贡献文档</a>,及时完善模型卡片内容。</p>
|
||||
|
||||
## Training Details
|
||||
|
||||
### Training Data
|
||||
|
||||
- For training, we used the [Inkuba-mono](https://huggingface.co/datasets/lelapa/Inkuba-Mono) dataset.
|
||||
|
||||
|
||||
|
||||
#### Training Hyperparameters
|
||||
|
||||
| Hyperparameter | Value |
|
||||
| ----------- | ----------- |
|
||||
| Total Parameters | 0.422B |
|
||||
| Hidden Size | 2048 |
|
||||
| Intermediate Size (MLPs) | 5632 |
|
||||
| Number of Attention Heads | 32 |
|
||||
| Number of Hidden Layers | 8 |
|
||||
| RMSNorm ɛ | 1e^-5 |
|
||||
| Max Seq Length | 2048 |
|
||||
| Vocab Size | 61788 |
|
||||
|
||||
## Limitations
|
||||
The InkubaLM model has been trained on multilingual datasets but does have some limitations. It is capable of understanding and generating content in five African languages: Swahili, Yoruba, Hausa, isiZulu, and isiXhosa, as well as English and French. While it can generate text on various topics, the resulting content may not always be entirely accurate, logically consistent, or free from biases found in the training data. Additionally, the model may sometimes use different languages when generating text. Nonetheless, this model is intended to be a foundational tool to aid research in African languages.
|
||||
|
||||
## Ethical Considerations and Risks
|
||||
InkubaLM is a small LM developed for five African languages. The model is evaluated only in sentiment analysis, machine translation, AfriMMLU, and AfriXNLI tasks and has yet to cover all possible evaluation scenarios. Similar to other language models, it is impossible to predict all of InkubaLM's potential outputs in advance, and in some cases, the model may produce inaccurate, biased, or objectionable responses. Therefore, before using the model in any application, the users should conduct safety testing and tuning tailored to their intended use.
|
||||
|
||||
## Citation
|
||||
|
||||
```
|
||||
@article{tonja2024inkubalm,
|
||||
title={InkubaLM: A small language model for low-resource African languages},
|
||||
author={Tonja, Atnafu Lambebo and Dossou, Bonaventure FP and Ojo, Jessica and Rajab, Jenalea and Thior, Fadel and Wairagala, Eric Peter and Anuoluwapo, Aremu and Moiloa, Pelonomi and Abbott, Jade and Marivate, Vukosi and others},
|
||||
journal={arXiv preprint arXiv:2408.17024},
|
||||
year={2024}
|
||||
}
|
||||
```
|
||||
|
||||
## Model Card Authors
|
||||
|
||||
[Lelapa AI](https://lelapa.ai/) - Fundamental Research Team
|
||||
|
||||
## Model Card Contact
|
||||
|
||||
[Lelapa AI](https://lelapa.ai/)
|
||||
|
||||
Reference in New Issue
Block a user