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
Upload demo/publish_space.py with huggingface_hub
Browse files- demo/publish_space.py +7 -11
demo/publish_space.py
CHANGED
|
@@ -24,25 +24,21 @@ STATIC_FILE_MAP = {
|
|
| 24 |
PROJECT_ROOT / "infer" / "common_infer.py": "infer/common_infer.py",
|
| 25 |
PROJECT_ROOT / "infer" / "infer.py": "infer/infer.py",
|
| 26 |
PROJECT_ROOT / "infer" / "infer.yaml": "infer/infer.yaml",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
|
| 29 |
-
DIRECTORIES_TO_UPLOAD = [
|
| 30 |
-
PROJECT_ROOT / "models",
|
| 31 |
-
PROJECT_ROOT / "tools",
|
| 32 |
-
]
|
| 33 |
-
|
| 34 |
|
| 35 |
def iter_uploads():
|
| 36 |
for local_path, remote_path in STATIC_FILE_MAP.items():
|
| 37 |
if local_path.exists():
|
| 38 |
yield local_path, remote_path
|
| 39 |
|
| 40 |
-
for directory in DIRECTORIES_TO_UPLOAD:
|
| 41 |
-
if not directory.exists():
|
| 42 |
-
continue
|
| 43 |
-
for local_path in directory.rglob("*.py"):
|
| 44 |
-
yield local_path, str(local_path.relative_to(PROJECT_ROOT))
|
| 45 |
-
|
| 46 |
|
| 47 |
def main():
|
| 48 |
parser = argparse.ArgumentParser(
|
|
|
|
| 24 |
PROJECT_ROOT / "infer" / "common_infer.py": "infer/common_infer.py",
|
| 25 |
PROJECT_ROOT / "infer" / "infer.py": "infer/infer.py",
|
| 26 |
PROJECT_ROOT / "infer" / "infer.yaml": "infer/infer.yaml",
|
| 27 |
+
PROJECT_ROOT / "models" / "__init__.py": "models/__init__.py",
|
| 28 |
+
PROJECT_ROOT / "models" / "mmdit.py": "models/mmdit.py",
|
| 29 |
+
PROJECT_ROOT / "models" / "multiLayer_adapter.py": "models/multiLayer_adapter.py",
|
| 30 |
+
PROJECT_ROOT / "models" / "pipeline.py": "models/pipeline.py",
|
| 31 |
+
PROJECT_ROOT / "models" / "transp_vae.py": "models/transp_vae.py",
|
| 32 |
+
PROJECT_ROOT / "tools" / "__init__.py": "tools/__init__.py",
|
| 33 |
+
PROJECT_ROOT / "tools" / "tools.py": "tools/tools.py",
|
| 34 |
}
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
def iter_uploads():
|
| 38 |
for local_path, remote_path in STATIC_FILE_MAP.items():
|
| 39 |
if local_path.exists():
|
| 40 |
yield local_path, remote_path
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
def main():
|
| 44 |
parser = argparse.ArgumentParser(
|