How to use from
vLLM
Install from pip and serve model
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "demo-at-wsld-8/blip-at-wsld-fashion200k"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "demo-at-wsld-8/blip-at-wsld-fashion200k",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Use Docker
docker model run hf.co/demo-at-wsld-8/blip-at-wsld-fashion200k
Quick Links

BLIP-base distilled (Attention Transfer + WSLD) — Fashion-200k captioning

Student model distill từ Salesforce/blip-image-captioning-large (Teacher) sang Salesforce/blip-image-captioning-base đã prune decoder (12 → 4 tầng), train trên Fashion-200k bằng combined loss:

  • Attention Transfer (AT) ở vision encoder — so khớp attention map giữa Student/Teacher.
  • WSLD (Weighted Soft Label Distillation) ở decoder — soft loss có trọng số theo token.
  • Cross-entropy với ground-truth caption.

Kiến trúc

  • Tham số: 148.4M | Kích thước: 283.0MB
  • Decoder giữ lại tầng: [0, 3, 6, 9]

Kết quả trên test set

{ "BLEU-4": 0.2458812827818811, "BLEU-1": 0.6297635645404903, "ROUGE-1": 0.5509984919361472, "ROUGE-2": 0.33081984865850167, "ROUGE-L": 0.4506778285021464, "METEOR": 0.40850410599132086, "CIDEr": 0.6211192626331922 }

Cách dùng

from huggingface_hub import hf_hub_download
from transformers import BlipForConditionalGeneration, BlipProcessor
import torch, json

repo_id = "demo-at-wsld-8/blip-at-wsld-fashion200k"
cfg = json.load(open(hf_hub_download(repo_id, "deploy_config.json"), encoding="utf-8"))
ckpt = hf_hub_download(repo_id, "student_at_wsld.pth")
# xem code dung lai kien truc (prune_decoder_layers, fix_decoder_layer_idx) trong app.py cua Space demo

Code training đầy đủ

Xem notebook Kaggle: https://www.kaggle.com/code/anhvunguyenquynh/at-wsld

Downloads last month
60
Safetensors
Model size
0.1B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using demo-at-wsld-8/blip-at-wsld-fashion200k 1