File size: 3,265 Bytes
29e16d1 b9fe0b0 29e16d1 b9fe0b0 5ab0925 b9fe0b0 62a3bb1 b9fe0b0 |
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 84 85 86 87 88 89 90 |
---
library_name: transformers
license: apache-2.0
language:
- aeb
base_model:
- inceptionai/jais-adapted-7b-chat
tags:
- text-generation-inference
- transformers
- unsloth
- trl
---
## Model Overview
Labess-7B-Instruct is an open model instruction-tuned for Tunisian Derja, is a continually pre-trained and aligned version of inceptionai/jais-adapted-7b-chat with Tunisian_Derja_Dataset
# Uploaded model
- **Developed by:** Linagora
- **License:** apache-2.0
- **Finetuned from model :** inceptionai/jais-adapted-7b-chat
## Usage
Below we share some code snippets on how to get quickly started with running the model. First, install the Transformers library with:
```sh
pip install transformers
```
#### Running with the `pipeline` API
```python
import torch
from transformers import pipeline
model_id= "linagora/Labess-7B-Instruct"
pipe = pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device="cuda" # replace with "mps" to run on a Mac device
)
messages = [
{"role": "user", "content": 'وين تجي تونس؟'},
]
outputs = pipe(messages, max_new_tokens=128, temperature=0.0)
assistant_response = outputs[0]["generated_text"][-1]["content"].strip()
print(assistant_response)
```
```
- Response:تونس هي بلاد في شمال إفريقيا. جات على الساحل متاع البحر الأبيض المتوسط. هي بلاد عندها تاريخ غني وهي من البلدان اللي فيها تنوع ثقافي كبير..
```
#### Running the model on a single / multi GPU
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto
model_id= "linagora/Labess-7B-Instruct"
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="cuda"
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
messages = [
{"role": "user", "content": "وين تجي تونس؟"},
]
input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True , add_generation_prompt=True).to(model.device)
outputs = model.generate(**input_ids, max_new_tokens=128)
print(tokenizer.decode(outputs[0]))
```
```
- Response:تونس هي بلاد في شمال إفريقيا. جات على الساحل متاع البحر الأبيض المتوسط. هي بلاد عندها تاريخ غني وهي من البلدان اللي فيها تنوع ثقافي كبير. تونس معروفة بالبحر متاعها وجمالها الطبيعي. هي بلاد فيها تنوع ثقافي كبير وفيها تنوع لغوي زادة. اللغة الرسمية متاع تونس هي العربية وفيها برشا متاع اللهجات اللي كيهضرو بيها الناس. تونس بلاد فيها تنوع ثقافي كبير وفيها تنوع لغوي زادة.
```
## Citations
When using this model ** Labess-7B-Instruct **, please cite:
```bibtex
@model{linagora2025LLM-tn,
author = {Wajdi Ghezaiel and Jean-Pierre Lorré},
title = {Labess-7B-Instruct :Tunisian Arabic Derja LLM based on jais-adapted-7b-chat},
year = {2025},
month = {July},
url = {https://huggingface.co/datasets/linagora/Labess-7B-Instruct}
}
``` |