MBZUAI-Paris/Egyptian-SFT-Mixture
Viewer • Updated • 1.85M • 415 • 6
How to use Mng-dev-ai/Nile-Chat-12B-MLX-4bit with MLX:
# Make sure mlx-lm is installed
# pip install --upgrade mlx-lm
# Generate text with mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("Mng-dev-ai/Nile-Chat-12B-MLX-4bit")
prompt = "Write a story about Einstein"
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True
)
text = generate(model, tokenizer, prompt=prompt, verbose=True)How to use Mng-dev-ai/Nile-Chat-12B-MLX-4bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Mng-dev-ai/Nile-Chat-12B-MLX-4bit"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "Mng-dev-ai/Nile-Chat-12B-MLX-4bit"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8080/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Mng-dev-ai/Nile-Chat-12B-MLX-4bit",
"messages": [
{"role": "user", "content": "Hello"}
]
}'MBZUAI-Paris/Nile-Chat-12B (Egyptian Arabic, based on Gemma 3 12B) converted to 4-bit MLX for Apple Silicon, ~6.6 GB.
mlx_lm.convert --quantize --q-bits 4 --q-group-size 64 (mlx-lm 0.32), unchanged otherwise.Nile-Chat follows instructions written in Egyptian Arabic and ignores English ones. For translation, send a single user message (no system message) in the format of its authors' evaluation prompts:
ترجم من المصري للإنجليزي:
<Egyptian Arabic text>
from mlx_lm import generate, load
model, tokenizer = load("<this repo>")
messages = [{"role": "user", "content": "ترجم من المصري للإنجليزي:\nالراجل ده دمه خفيف جدا"}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
print(generate(model, tokenizer, prompt=prompt, max_tokens=120)) # He's a funny guy.
Gemma is provided under and subject to the Gemma Terms of Use, including the
Gemma Prohibited Use Policy. See notice.txt. All rights in the
original model remain with MBZUAI-Paris and Google.
4-bit