Instructions to use ameer4wisam/gemma-iraqi-10k-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ameer4wisam/gemma-iraqi-10k-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ameer4wisam/gemma-iraqi-10k-merged") 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("ameer4wisam/gemma-iraqi-10k-merged") model = AutoModelForMultimodalLM.from_pretrained("ameer4wisam/gemma-iraqi-10k-merged", device_map="auto") 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 ameer4wisam/gemma-iraqi-10k-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ameer4wisam/gemma-iraqi-10k-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ameer4wisam/gemma-iraqi-10k-merged", "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/ameer4wisam/gemma-iraqi-10k-merged
- SGLang
How to use ameer4wisam/gemma-iraqi-10k-merged 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 "ameer4wisam/gemma-iraqi-10k-merged" \ --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": "ameer4wisam/gemma-iraqi-10k-merged", "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 "ameer4wisam/gemma-iraqi-10k-merged" \ --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": "ameer4wisam/gemma-iraqi-10k-merged", "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" } } ] } ] }' - Docker Model Runner
How to use ameer4wisam/gemma-iraqi-10k-merged with Docker Model Runner:
docker model run hf.co/ameer4wisam/gemma-iraqi-10k-merged
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("ameer4wisam/gemma-iraqi-10k-merged")
model = AutoModelForMultimodalLM.from_pretrained("ameer4wisam/gemma-iraqi-10k-merged", device_map="auto")
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]:]))Gemma 4 12B — اللهجة العراقية (مدموج)
نموذج كامل مدموج: محوّل LoRA مدرَّب على اللهجة العراقية مدموج داخل
google/gemma-4-12B-it. ما يحتاج تحميل محوّل منفصل ولا مكتبة peft.
الدمج انسوى بـAutoModelForImageTextToText مو AutoModelForCausalLM، حتى
تنحفظ أبراج الرؤية والصوت — الدمج بالكلاس النصي يفقدها.
| النموذج الأساسي | google/gemma-4-12B-it |
| المحوّل المصدر | ameer4wisam/gemma-iraqi-10k |
| بيانات التدريب | 14,000 مثال عراقي + ~15% تعليمات عامة (Aya) |
| الوسائط | نص + صورة (محفوظة بعد الدمج) |
الاستخدام
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
model_id = "ameer4wisam/gemma-iraqi-10k-merged"
model = AutoModelForImageTextToText.from_pretrained(
model_id, dtype=torch.bfloat16, device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id)
msgs = [
{"role": "system", "content": "أنت مساعد عراقي تحچي باللهجة العراقية العامية."},
{"role": "user", "content": "شلونك؟ شنو أشهر أكلة عراقية؟"},
]
inputs = processor.apply_chat_template(
msgs, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt"
).to(model.device)
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
سلوك الوكيل
بيانات التدريب فيها 690 مثالاً تعلّم سلوك مساعد مبيعات: الإحالة
(اتأكدلك وأرد عليك) بدل اختراع الضمان والأسعار، رفض البراند غير
المتوفر باسمه، تأجيل الحساب، علامة [ORDER_READY] بعد التأكيد الصريح
حصراً، واستدعاء الأدوات بصيغة [TOOL_CALL].
هذي السلوكيات تعتمد على رسالة نظام تحدد الكتالوج والقواعد.
الحدود
- اللهجة العراقية مو موحّدة؛ الداتا تميل للهجة الوسط والجنوب.
- الأسعار والمنتجات بأمثلة التدريب توضيحية، مو كتالوج حقيقي.
- ما انقاس على معيار عام منشور؛ التقييم داخلي بدفتر التدريب.
المصدر: https://github.com/ameer20042005/iraqi_words_finetuning
- Downloads last month
- 55
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ameer4wisam/gemma-iraqi-10k-merged") 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)