Views
No views yet
1from unsloth import FastVisionModel
2device = "cuda" # veya "cpu"
3model, tokenizer = FastVisionModel.from_pretrained(
4 "OrionCAF/qwen2_5_turkish_vlm",
5 load_in_4bit = False, # fp16 yüklüyorsanız False yapın
6 trust_remote_code = True,
7)
8
9FastVisionModel.for_inference(model)
10
11from PIL import Image
12img = Image.open("örnek.jpg")
13
14messages = [{
15 "role": "user",
16 "content": [
17 {"type": "text", "text": "Bu fotoğrafta neler görüyorsun?"},
18 {"type": "image", "image": img},
19 ],
20}]
21chat = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
22inputs = tokenizer(img, chat, add_special_tokens=False,
23 return_tensors="pt").to(model.device)
24
25out = model.generate(**inputs, max_new_tokens=128,
26 temperature=0.8, top_p=0.9)
27print(tokenizer.decode(out[0], skip_special_tokens=True))| Özellik | Değer |
|---|---|
| Temel Model | unsloth/Qwen2.5-VL-7B-Instruct-bnb-4bit |
| Eğitim Yöntemi | LoRA (rank = 32) + merge_and_unload() |
| Veri Seti | ucsahin/Turkish-VLM-Mix-Benchmark( özel olarak teşekkür ederim ) (coco_qa_tr, docci_tr, ist_plq_tr, …) |
| Maks. Sekans | 2048 token (metin), 224×224 görsel yaması |
| Dil Desteği | Türkçe (birincil), İngilizce (ek) |
| Lisans | Apache-2.0 |
Ekibe katılmak veya geri bildirim vermek için GitHub issues veya Hugging Face Discussions bölümünü kullanabilirsiniz.