Instructions to use leobo09263013/focal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use leobo09263013/focal with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="leobo09263013/focal", trust_remote_code=True) 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("leobo09263013/focal", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("leobo09263013/focal", trust_remote_code=True, 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use leobo09263013/focal with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "leobo09263013/focal" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "leobo09263013/focal", "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/leobo09263013/focal
- SGLang
How to use leobo09263013/focal 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 "leobo09263013/focal" \ --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": "leobo09263013/focal", "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 "leobo09263013/focal" \ --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": "leobo09263013/focal", "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 leobo09263013/focal with Docker Model Runner:
docker model run hf.co/leobo09263013/focal
Qwen3-VL-8B AURA Focal
Final model from one epoch of AURA full fine-tuning of
Qwen/Qwen3-VL-8B-Instruct with token-level Focal loss (gamma=2.0).
This repository contains the final BF16 model weights, tokenizer, custom model
and processor code, and training summary. External evaluation has not been performed.
Training
- Base revision:
0c351dd01ed87e9c1b53cbc748cba10e6187ff3b. - 173,553 cached training examples; 2,712 optimizer steps; one epoch.
- 32 GPUs; per-device batch 1; gradient accumulation 2; global batch 64.
- Learning rate 1e-5; cosine scheduler; warmup ratio 0.1; seed 42.
- BF16, FlashAttention 2, DeepSpeed ZeRO-3; sequence limit 11,000 tokens.
- AURA answer selection and silent-token weighting are preserved. Focal modulation applies to all retained supervised tokens, with the original weighted-token denominator.
- Visual patch embedding, transformer blocks, deepstack mergers and projector
are frozen.
model.visual.pos_embed.weightremains trainable to match the CE baseline. The language model and LM head are trainable.
Mean training Focal loss: 0.493920. Final logged step loss: 0.3440. Focal loss values cannot be directly compared with CE values as model-quality scores.
Loading
Tested with Transformers 4.57.1 and PyTorch 2.6.0.
import torch
from transformers import AutoModelForCausalLM, AutoProcessor
model_id = "leobo09263013/focal"
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id, trust_remote_code=True, dtype=torch.bfloat16, device_map="auto"
)
The checkpoint retains the custom <|silent|> token (ID 151669). The saved
Fast tokenizer removes it when skip_special_tokens=True; account for that
when evaluating silence decisions.
For continued training, Focal is a runtime loss hook and is not restored by
loading model weights alone. Reattach it from training/aura_loss.py using
attach_aura_loss(model, processor.tokenizer, "focal", focal_gamma=2.0).
The original CE model implementation is retained in the custom model file.
This export does not contain the distributed optimizer state.
- Downloads last month
- -
Model tree for leobo09263013/focal
Base model
Qwen/Qwen3-VL-8B-Instruct