Image-Text-to-Text
Transformers
Diffusers
Safetensors
qwen3_vl
vision-language-model
image-decomposition
conversational
Instructions to use SynLayers/Bbox-caption-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SynLayers/Bbox-caption-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SynLayers/Bbox-caption-8b") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("SynLayers/Bbox-caption-8b") model = AutoModelForImageTextToText.from_pretrained("SynLayers/Bbox-caption-8b") 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
- vLLM
How to use SynLayers/Bbox-caption-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SynLayers/Bbox-caption-8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SynLayers/Bbox-caption-8b", "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/SynLayers/Bbox-caption-8b
- SGLang
How to use SynLayers/Bbox-caption-8b 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 "SynLayers/Bbox-caption-8b" \ --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": "SynLayers/Bbox-caption-8b", "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 "SynLayers/Bbox-caption-8b" \ --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": "SynLayers/Bbox-caption-8b", "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 SynLayers/Bbox-caption-8b with Docker Model Runner:
docker model run hf.co/SynLayers/Bbox-caption-8b
| set -euo pipefail | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| PYTHON_BIN="${PYTHON_BIN:-python}" | |
| : "${BLENDED_DIR:?Set BLENDED_DIR}" | |
| : "${LAION_DIR:?Set LAION_DIR}" | |
| : "${CAPTION_DIR:?Set CAPTION_DIR}" | |
| : "${OUTPUT_DIR:?Set OUTPUT_DIR}" | |
| CAPTION_META="${CAPTION_META:-${CAPTION_DIR}/captions.jsonl}" | |
| NUM_SAMPLES="${NUM_SAMPLES:-500000}" | |
| START_INDEX="${START_INDEX:-0}" | |
| SEED="${SEED:-42}" | |
| MAX_BASE_SAMPLES="${MAX_BASE_SAMPLES:-18000}" | |
| MIN_DONOR_SAMPLES="${MIN_DONOR_SAMPLES:-1}" | |
| MAX_DONOR_SAMPLES="${MAX_DONOR_SAMPLES:-4}" | |
| MIN_LAYERS_PER_DONOR="${MIN_LAYERS_PER_DONOR:-0}" | |
| MAX_LAYERS_PER_DONOR="${MAX_LAYERS_PER_DONOR:-2}" | |
| MIN_LAYERS_TO_REMOVE="${MIN_LAYERS_TO_REMOVE:-1}" | |
| MAX_LAYERS_TO_REMOVE="${MAX_LAYERS_TO_REMOVE:-4}" | |
| ADDED_LAYER_MIN_SIZE="${ADDED_LAYER_MIN_SIZE:-0.9}" | |
| ADDED_LAYER_MAX_SIZE="${ADDED_LAYER_MAX_SIZE:-1.1}" | |
| LAION_PROB="${LAION_PROB:-0.60}" | |
| CAPTION_PROB="${CAPTION_PROB:-0.35}" | |
| LAION_MIN_SIZE="${LAION_MIN_SIZE:-0.3}" | |
| LAION_MAX_SIZE="${LAION_MAX_SIZE:-0.4}" | |
| CAPTION_MIN_SIZE="${CAPTION_MIN_SIZE:-0.6}" | |
| CAPTION_MAX_SIZE="${CAPTION_MAX_SIZE:-0.8}" | |
| ALPHAVAE_MIN_LAYERS="${ALPHAVAE_MIN_LAYERS:-0}" | |
| ALPHAVAE_MAX_LAYERS="${ALPHAVAE_MAX_LAYERS:-0}" | |
| ALPHAVAE_MIN_SIZE="${ALPHAVAE_MIN_SIZE:-0.25}" | |
| ALPHAVAE_MAX_SIZE="${ALPHAVAE_MAX_SIZE:-0.40}" | |
| NUM_WORKERS="${NUM_WORKERS:-64}" | |
| SKIP_EXISTING="${SKIP_EXISTING:-0}" | |
| cmd=( | |
| "$PYTHON_BIN" "$SCRIPT_DIR/scaleup_dataset.py" | |
| --blended_dir "$BLENDED_DIR" | |
| --laion_dir "$LAION_DIR" | |
| --caption_dir "$CAPTION_DIR" | |
| --caption_meta "$CAPTION_META" | |
| --output_dir "$OUTPUT_DIR" | |
| --num_samples "$NUM_SAMPLES" | |
| --start_index "$START_INDEX" | |
| --seed "$SEED" | |
| --min_donor_samples "$MIN_DONOR_SAMPLES" | |
| --max_donor_samples "$MAX_DONOR_SAMPLES" | |
| --min_layers_per_donor "$MIN_LAYERS_PER_DONOR" | |
| --max_layers_per_donor "$MAX_LAYERS_PER_DONOR" | |
| --added_layer_min_size "$ADDED_LAYER_MIN_SIZE" | |
| --added_layer_max_size "$ADDED_LAYER_MAX_SIZE" | |
| --laion_prob "$LAION_PROB" | |
| --caption_prob "$CAPTION_PROB" | |
| --laion_min_size "$LAION_MIN_SIZE" | |
| --laion_max_size "$LAION_MAX_SIZE" | |
| --caption_min_size "$CAPTION_MIN_SIZE" | |
| --caption_max_size "$CAPTION_MAX_SIZE" | |
| --min_layers_to_remove "$MIN_LAYERS_TO_REMOVE" | |
| --max_layers_to_remove "$MAX_LAYERS_TO_REMOVE" | |
| --alphavae_min_layers "$ALPHAVAE_MIN_LAYERS" | |
| --alphavae_max_layers "$ALPHAVAE_MAX_LAYERS" | |
| --alphavae_min_size "$ALPHAVAE_MIN_SIZE" | |
| --alphavae_max_size "$ALPHAVAE_MAX_SIZE" | |
| --max_base_samples "$MAX_BASE_SAMPLES" | |
| --num_workers "$NUM_WORKERS" | |
| ) | |
| if [[ -n "${ALPHAVAE_DIR:-}" ]]; then | |
| cmd+=(--alphavae_dir "$ALPHAVAE_DIR") | |
| fi | |
| if [[ -n "${ALPHAVAE_PROMPTS:-}" ]]; then | |
| cmd+=(--alphavae_prompts "$ALPHAVAE_PROMPTS") | |
| fi | |
| if [[ "$SKIP_EXISTING" == "1" ]]; then | |
| cmd+=(--skip_existing) | |
| fi | |
| "${cmd[@]}" | |