Image-Text-to-Text
Transformers
Safetensors
Indonesian
qwen3_5
image-captioning
qwen3.5
bahasa-indonesia
lora
lora-merged
vlm
multimodal
json-output
conversational
Instructions to use Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA") 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("Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA") model = AutoModelForMultimodalLM.from_pretrained("Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA", 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 Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA", "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/Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA
- SGLang
How to use Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA 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 "Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA" \ --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": "Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA", "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 "Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA" \ --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": "Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA", "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 Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA with Docker Model Runner:
docker model run hf.co/Adicandra/Qwen3.5-4B-ImageCaptioning-LoRA
Update README.md
Browse files
README.md
CHANGED
|
@@ -37,7 +37,6 @@ Model ini merupakan hasil fine-tuning (LoRA, sudah di-**merge** ke base weights)
|
|
| 37 |
| `enable_thinking` saat training | `False` |
|
| 38 |
| EOS token | `<\|im_end\|>` (+ `<\|endoftext\|>`) |
|
| 39 |
| Precision | bfloat16 |
|
| 40 |
-
| Attention impl | FlashAttention-2 (Ampere+) / SDPA (fallback) |
|
| 41 |
|
| 42 |
---
|
| 43 |
|
|
@@ -57,7 +56,6 @@ model = AutoModelForImageTextToText.from_pretrained(
|
|
| 57 |
REPO,
|
| 58 |
torch_dtype=torch.bfloat16,
|
| 59 |
device_map="auto",
|
| 60 |
-
attn_implementation="flash_attention_2", # ganti "sdpa" jika bukan Ampere+
|
| 61 |
)
|
| 62 |
model.eval()
|
| 63 |
```
|
|
@@ -198,7 +196,6 @@ Model di-train dengan `enable_thinking=False`. Pastikan argumen tersebut selalu
|
|
| 198 |
## Keterbatasan & Catatan
|
| 199 |
|
| 200 |
- Model hanya menghasilkan caption **Bahasa Indonesia**; tidak dirancang untuk bahasa lain.
|
| 201 |
-
- Inferensi optimal pada GPU dengan dukungan **FlashAttention-2** (Ampere ke atas). Pada T4, gunakan `attn_implementation="sdpa"`.
|
| 202 |
- Untuk input resolusi tinggi (> 560×560), model tetap berfungsi tetapi performa optimal pada thumbnail 560×560.
|
| 203 |
- **Jangan tebak identitas/nama orang** dari gambar — sesuai aturan system prompt.
|
| 204 |
- Evaluasi formal (CIDEr, BLEU, METEOR) belum tersedia; performa diukur secara kualitatif.
|
|
|
|
| 37 |
| `enable_thinking` saat training | `False` |
|
| 38 |
| EOS token | `<\|im_end\|>` (+ `<\|endoftext\|>`) |
|
| 39 |
| Precision | bfloat16 |
|
|
|
|
| 40 |
|
| 41 |
---
|
| 42 |
|
|
|
|
| 56 |
REPO,
|
| 57 |
torch_dtype=torch.bfloat16,
|
| 58 |
device_map="auto",
|
|
|
|
| 59 |
)
|
| 60 |
model.eval()
|
| 61 |
```
|
|
|
|
| 196 |
## Keterbatasan & Catatan
|
| 197 |
|
| 198 |
- Model hanya menghasilkan caption **Bahasa Indonesia**; tidak dirancang untuk bahasa lain.
|
|
|
|
| 199 |
- Untuk input resolusi tinggi (> 560×560), model tetap berfungsi tetapi performa optimal pada thumbnail 560×560.
|
| 200 |
- **Jangan tebak identitas/nama orang** dari gambar — sesuai aturan system prompt.
|
| 201 |
- Evaluasi formal (CIDEr, BLEU, METEOR) belum tersedia; performa diukur secara kualitatif.
|