Instructions to use awras/awras-chat-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use awras/awras-chat-v0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="awras/awras-chat-v0") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("awras/awras-chat-v0") model = AutoModelForMultimodalLM.from_pretrained("awras/awras-chat-v0") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use awras/awras-chat-v0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "awras/awras-chat-v0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "awras/awras-chat-v0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/awras/awras-chat-v0
- SGLang
How to use awras/awras-chat-v0 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "awras/awras-chat-v0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "awras/awras-chat-v0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "awras/awras-chat-v0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "awras/awras-chat-v0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Studio
How to use awras/awras-chat-v0 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for awras/awras-chat-v0 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for awras/awras-chat-v0 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for awras/awras-chat-v0 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="awras/awras-chat-v0", max_seq_length=2048, ) - Docker Model Runner
How to use awras/awras-chat-v0 with Docker Model Runner:
docker model run hf.co/awras/awras-chat-v0
awras/awras-chat-v0
awras-chat-v0 is a conversational language model built specifically for Algerian Darija, the everyday spoken dialect of Algeria. It is the first chat release from the awras project, which aims to build open Arabic dialect AI for the Algerian community.
The model is built on a Gemma3 4B architecture and fine-tuned in two phases: first to learn the Darija language and its patterns, then to follow instructions and hold conversations.
Due to specific tokenization and generation configurations, it is highly recommended to run this model using the unsloth library to ensure proper ChatML formatting and optimal inference speed.
Installation
Run the following setup to install unsloth and its required dependencies. This works for both local setups and cloud environments like Google Colab.
%%capture
import os, re
if "COLAB_" not in "".join(os.environ.keys()):
!pip install unsloth # Do this in local & cloud setups
else:
import torch; v = re.match(r'[\d]{1,}\.[\d]{1,}', str(torch.__version__)).group(0)
xformers = 'xformers==' + {'2.10':'0.0.34','2.9':'0.0.33.post1','2.8':'0.0.32.post2'}.get(v, "0.0.34")
!pip install sentencepiece protobuf "datasets==4.3.0" "huggingface_hub>=0.34.0" hf_transfer
!pip install --no-deps unsloth_zoo bitsandbytes accelerate {xformers} peft trl triton unsloth
!pip install transformers==4.56.2
!pip install --no-deps trl==0.22.2
Usage
import unsloth
from unsloth.chat_templates import get_chat_template
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "awras/awras-chat-v0"
# 1. Load tokenizer and force ChatML template
tokenizer = AutoTokenizer.from_pretrained(model_id, token=hf_token)
tokenizer = get_chat_template(tokenizer, chat_template="chatml")
# 2. Load the model on CUDA to prevent accelerate hook conflicts
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="cuda",
token=hf_token
)
# 3. Define your prompt
messages = [
{"role": "user", "content": "كيفاش ندير الحريرة الوهرانية؟"}
]
# 4. Format inputs
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
return_tensors="pt",
add_generation_prompt=True,
return_dict=True
).to(model.device)
im_end_id = tokenizer.convert_tokens_to_ids("<|im_end|>")
# Suppress pad_token_id warnings
if tokenizer.pad_token_id is None:
tokenizer.pad_token_id = tokenizer.eos_token_id
# 5. Generate response
output = model.generate(
**inputs,
max_new_tokens=200,
temperature=0.7,
top_p=0.9,
do_sample=True,
eos_token_id=im_end_id,
pad_token_id=tokenizer.pad_token_id
)
# 6. Decode and print only the new generated tokens
input_length = inputs['input_ids'].shape[-1]
generated_tokens = output[0][input_length:]
print(tokenizer.decode(generated_tokens, skip_special_tokens=True))
Developed by: bahaeddine09
- Downloads last month
- 45
Model tree for awras/awras-chat-v0
Base model
bahaeddine09/awras-pt-0