File size: 2,542 Bytes
aae5e06 7fc72d2 aae5e06 9d4921a 7fc72d2 aae5e06 b477eb9 835b8fc b477eb9 aae5e06 5ebcc8e 5a5f9f8 5ebcc8e 5a5f9f8 aae5e06 7fc72d2 |
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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
---
base_model: unsloth/mistral-7b-v0.3-bnb-4bit
language:
- en
- kg
license: apache-2.0
tags:
- text-generation-inference
- transformers
- unsloth
- mistral
- trl
- sft
datasets:
- wikimedia/wikipedia
- Svngoku/xP3x-Kongo
---
# Kongostral
Kongostral is a continious pretrained version of the mistral model (`Mistral v3`) on Kikongo Wikipedia Corpus and fine-tuned on Kikongo Translated text from xP3x using the alcapa format.
The goal of this model is to produce a SOTA model who can easily predict the next token on Kikongo sentences and produce instruction base text generation.
- **Developed by:** Svngoku
- **License:** apache-2.0
- **Finetuned from model :** unsloth/mistral-7b-v0.3-bnb-4bit
## Inference with Unsloth
```py
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
inputs = tokenizer([
alpaca_prompt.format(
#"", # instruction
"Inki bima ke salaka ba gâteau ya pomme ya nsungi ?", # instruction
"", # output - leave this blank for generation!
)],
return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True)
tokenizer.batch_decode(outputs)
```
## Inference with Transformers 🤗
```sh
!pip install -q -U bitsandbytes
!pip install -q -U git+https://github.com/huggingface/transformers.git
!pip install -q -U git+https://github.com/huggingface/peft.git
!pip install -q -U git+https://github.com/huggingface/accelerate.git
```
```py
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
import torch
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16
)
tokenizer = AutoTokenizer.from_pretrained("Svngoku/kongostral")
model = AutoModelForCausalLM.from_pretrained("Svngoku/kongostral", quantization_config=quantization_config)
prompt = "Inki kele Nsangu ya kisika yai ?"
model_inputs = tokenizer([prompt], return_tensors="pt").to("cuda")
generated_ids = model.generate(**model_inputs, max_new_tokens=500, do_sample=True)
tokenizer.batch_decode(generated_ids)[0]
```
## Observation
The model may produce results that are not accurate as requested by the user.
There is still work to be done to align and get more accurate results.
### Note
This mistral model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth) |