Image-Text-to-Text
Transformers
Safetensors
qwen3_vl_moe
robotics
embodied-ai
video-understanding
progress-estimation
reward-modeling
qwen3-vl
conversational
Instructions to use InternRobotics/VLAC-Cut with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use InternRobotics/VLAC-Cut with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="InternRobotics/VLAC-Cut") 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("InternRobotics/VLAC-Cut") model = AutoModelForMultimodalLM.from_pretrained("InternRobotics/VLAC-Cut", 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 InternRobotics/VLAC-Cut with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "InternRobotics/VLAC-Cut" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InternRobotics/VLAC-Cut", "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/InternRobotics/VLAC-Cut
- SGLang
How to use InternRobotics/VLAC-Cut 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 "InternRobotics/VLAC-Cut" \ --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": "InternRobotics/VLAC-Cut", "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 "InternRobotics/VLAC-Cut" \ --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": "InternRobotics/VLAC-Cut", "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 InternRobotics/VLAC-Cut with Docker Model Runner:
docker model run hf.co/InternRobotics/VLAC-Cut
Trim quick start release docs and remove internal verification helper
Browse files- README.md +0 -10
- quick_start/README.md +0 -12
- quick_start/verify_prediction_consistency.py +0 -148
README.md
CHANGED
|
@@ -77,14 +77,4 @@ python quick_start/render_prediction_video.py \
|
|
| 77 |
--output-video quick_start/outputs/example_01_pred_progress.mp4
|
| 78 |
```
|
| 79 |
|
| 80 |
-
Verify consistency with the bundled reference outputs:
|
| 81 |
-
|
| 82 |
-
```bash
|
| 83 |
-
python quick_start/verify_prediction_consistency.py \
|
| 84 |
-
--pred-jsonl quick_start/outputs/example_01.jsonl \
|
| 85 |
-
--reference-jsonl examples/reference_outputs/example_01.jsonl \
|
| 86 |
-
--pred-video quick_start/outputs/example_01_pred_progress.mp4 \
|
| 87 |
-
--reference-video examples/reference_outputs/example_01_pred_progress.mp4
|
| 88 |
-
```
|
| 89 |
-
|
| 90 |
More detailed usage is provided in `quick_start/README.md`.
|
|
|
|
| 77 |
--output-video quick_start/outputs/example_01_pred_progress.mp4
|
| 78 |
```
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
More detailed usage is provided in `quick_start/README.md`.
|
quick_start/README.md
CHANGED
|
@@ -66,12 +66,6 @@ python quick_start/run_example.py \
|
|
| 66 |
python quick_start/render_prediction_video.py \
|
| 67 |
--input-jsonl quick_start/outputs/example_01.jsonl \
|
| 68 |
--output-video quick_start/outputs/example_01_pred_progress.mp4
|
| 69 |
-
|
| 70 |
-
python quick_start/verify_prediction_consistency.py \
|
| 71 |
-
--pred-jsonl quick_start/outputs/example_01.jsonl \
|
| 72 |
-
--reference-jsonl examples/reference_outputs/example_01.jsonl \
|
| 73 |
-
--pred-video quick_start/outputs/example_01_pred_progress.mp4 \
|
| 74 |
-
--reference-video examples/reference_outputs/example_01_pred_progress.mp4
|
| 75 |
```
|
| 76 |
|
| 77 |
All three bundled examples:
|
|
@@ -86,12 +80,6 @@ for ex in example_01 example_02 example_03; do
|
|
| 86 |
python quick_start/render_prediction_video.py \
|
| 87 |
--input-jsonl "quick_start/outputs/${ex}.jsonl" \
|
| 88 |
--output-video "quick_start/outputs/${ex}_pred_progress.mp4"
|
| 89 |
-
|
| 90 |
-
python quick_start/verify_prediction_consistency.py \
|
| 91 |
-
--pred-jsonl "quick_start/outputs/${ex}.jsonl" \
|
| 92 |
-
--reference-jsonl "examples/reference_outputs/${ex}.jsonl" \
|
| 93 |
-
--pred-video "quick_start/outputs/${ex}_pred_progress.mp4" \
|
| 94 |
-
--reference-video "examples/reference_outputs/${ex}_pred_progress.mp4"
|
| 95 |
done
|
| 96 |
```
|
| 97 |
|
|
|
|
| 66 |
python quick_start/render_prediction_video.py \
|
| 67 |
--input-jsonl quick_start/outputs/example_01.jsonl \
|
| 68 |
--output-video quick_start/outputs/example_01_pred_progress.mp4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
All three bundled examples:
|
|
|
|
| 80 |
python quick_start/render_prediction_video.py \
|
| 81 |
--input-jsonl "quick_start/outputs/${ex}.jsonl" \
|
| 82 |
--output-video "quick_start/outputs/${ex}_pred_progress.mp4"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
done
|
| 84 |
```
|
| 85 |
|
quick_start/verify_prediction_consistency.py
DELETED
|
@@ -1,148 +0,0 @@
|
|
| 1 |
-
#!/usr/bin/env python3
|
| 2 |
-
from __future__ import annotations
|
| 3 |
-
|
| 4 |
-
import argparse
|
| 5 |
-
import hashlib
|
| 6 |
-
import json
|
| 7 |
-
from pathlib import Path
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
def parse_args() -> argparse.Namespace:
|
| 11 |
-
parser = argparse.ArgumentParser(
|
| 12 |
-
description="Verify that a newly generated prediction JSONL/video matches a reference output.",
|
| 13 |
-
)
|
| 14 |
-
parser.add_argument("--pred-jsonl", type=Path, required=True, help="Newly generated prediction JSONL.")
|
| 15 |
-
parser.add_argument("--reference-jsonl", type=Path, required=True, help="Reference prediction JSONL.")
|
| 16 |
-
parser.add_argument("--pred-video", type=Path, default=None, help="Optional newly generated preview video.")
|
| 17 |
-
parser.add_argument("--reference-video", type=Path, default=None, help="Optional reference preview video.")
|
| 18 |
-
parser.add_argument("--tolerance", type=float, default=1e-6, help="Numeric tolerance for float comparisons.")
|
| 19 |
-
return parser.parse_args()
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
def load_row(path: Path) -> dict:
|
| 23 |
-
lines = path.read_text(encoding="utf-8").splitlines()
|
| 24 |
-
if not lines:
|
| 25 |
-
raise SystemExit(f"Empty JSONL file: {path}")
|
| 26 |
-
return json.loads(lines[0])
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
def get_alias_value(row: dict, *keys: str):
|
| 30 |
-
for key in keys:
|
| 31 |
-
if key in row:
|
| 32 |
-
return row[key]
|
| 33 |
-
return None
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
def compare_numeric_lists(name: str, lhs, rhs, tolerance: float, errors: list[str]) -> None:
|
| 37 |
-
if lhs is None or rhs is None:
|
| 38 |
-
errors.append(f"{name}: missing on one side")
|
| 39 |
-
return
|
| 40 |
-
if len(lhs) != len(rhs):
|
| 41 |
-
errors.append(f"{name}: length mismatch {len(lhs)} != {len(rhs)}")
|
| 42 |
-
return
|
| 43 |
-
for idx, (a, b) in enumerate(zip(lhs, rhs, strict=True)):
|
| 44 |
-
if abs(float(a) - float(b)) > tolerance:
|
| 45 |
-
errors.append(f"{name}: mismatch at index {idx}: {a} != {b}")
|
| 46 |
-
return
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
def sha256_file(path: Path) -> str:
|
| 50 |
-
h = hashlib.sha256()
|
| 51 |
-
with path.open("rb") as f:
|
| 52 |
-
while True:
|
| 53 |
-
chunk = f.read(1024 * 1024)
|
| 54 |
-
if not chunk:
|
| 55 |
-
break
|
| 56 |
-
h.update(chunk)
|
| 57 |
-
return h.hexdigest()
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
def main() -> int:
|
| 61 |
-
args = parse_args()
|
| 62 |
-
pred_row = load_row(args.pred_jsonl.resolve())
|
| 63 |
-
ref_row = load_row(args.reference_jsonl.resolve())
|
| 64 |
-
errors: list[str] = []
|
| 65 |
-
|
| 66 |
-
pred_response = str(pred_row.get("response", "")).strip()
|
| 67 |
-
ref_response = str(ref_row.get("response", "")).strip()
|
| 68 |
-
if pred_response != ref_response:
|
| 69 |
-
errors.append("response: text mismatch")
|
| 70 |
-
|
| 71 |
-
pred_parse_ok = bool(pred_row.get("pred_curve_parse_ok"))
|
| 72 |
-
ref_parse_ok = bool(ref_row.get("pred_curve_parse_ok"))
|
| 73 |
-
if pred_parse_ok != ref_parse_ok:
|
| 74 |
-
errors.append(f"pred_curve_parse_ok: mismatch {pred_parse_ok} != {ref_parse_ok}")
|
| 75 |
-
|
| 76 |
-
compare_numeric_lists(
|
| 77 |
-
"pred_curve_point_times_sec",
|
| 78 |
-
pred_row.get("pred_curve_point_times_sec"),
|
| 79 |
-
ref_row.get("pred_curve_point_times_sec"),
|
| 80 |
-
args.tolerance,
|
| 81 |
-
errors,
|
| 82 |
-
)
|
| 83 |
-
compare_numeric_lists(
|
| 84 |
-
"pred_curve_point_progress",
|
| 85 |
-
pred_row.get("pred_curve_point_progress"),
|
| 86 |
-
ref_row.get("pred_curve_point_progress"),
|
| 87 |
-
args.tolerance,
|
| 88 |
-
errors,
|
| 89 |
-
)
|
| 90 |
-
|
| 91 |
-
compare_numeric_lists(
|
| 92 |
-
"input_frame_indices",
|
| 93 |
-
get_alias_value(pred_row, "input_frame_indices", "input_frame_indices_2hz"),
|
| 94 |
-
get_alias_value(ref_row, "input_frame_indices", "input_frame_indices_2hz"),
|
| 95 |
-
args.tolerance,
|
| 96 |
-
errors,
|
| 97 |
-
)
|
| 98 |
-
compare_numeric_lists(
|
| 99 |
-
"input_timestamps_sec",
|
| 100 |
-
get_alias_value(pred_row, "input_timestamps_sec", "input_timestamps_sec_2hz"),
|
| 101 |
-
get_alias_value(ref_row, "input_timestamps_sec", "input_timestamps_sec_2hz"),
|
| 102 |
-
args.tolerance,
|
| 103 |
-
errors,
|
| 104 |
-
)
|
| 105 |
-
|
| 106 |
-
pred_sample_hz = float(get_alias_value(pred_row, "input_sample_hz") or 0.0)
|
| 107 |
-
ref_sample_hz = float(get_alias_value(ref_row, "input_sample_hz") or 0.0)
|
| 108 |
-
if abs(pred_sample_hz - ref_sample_hz) > args.tolerance:
|
| 109 |
-
errors.append(f"input_sample_hz: mismatch {pred_sample_hz} != {ref_sample_hz}")
|
| 110 |
-
|
| 111 |
-
pred_frame_count = int(get_alias_value(pred_row, "input_frame_count", "input_frame_count_2hz") or 0)
|
| 112 |
-
ref_frame_count = int(get_alias_value(ref_row, "input_frame_count", "input_frame_count_2hz") or 0)
|
| 113 |
-
if pred_frame_count != ref_frame_count:
|
| 114 |
-
errors.append(f"input_frame_count: mismatch {pred_frame_count} != {ref_frame_count}")
|
| 115 |
-
|
| 116 |
-
if args.pred_video is not None or args.reference_video is not None:
|
| 117 |
-
if args.pred_video is None or args.reference_video is None:
|
| 118 |
-
errors.append("video comparison requires both --pred-video and --reference-video")
|
| 119 |
-
else:
|
| 120 |
-
pred_video = args.pred_video.resolve()
|
| 121 |
-
ref_video = args.reference_video.resolve()
|
| 122 |
-
if not pred_video.exists():
|
| 123 |
-
errors.append(f"Missing pred video: {pred_video}")
|
| 124 |
-
if not ref_video.exists():
|
| 125 |
-
errors.append(f"Missing reference video: {ref_video}")
|
| 126 |
-
if pred_video.exists() and ref_video.exists():
|
| 127 |
-
pred_sha = sha256_file(pred_video)
|
| 128 |
-
ref_sha = sha256_file(ref_video)
|
| 129 |
-
if pred_sha != ref_sha:
|
| 130 |
-
errors.append(f"preview_video: sha256 mismatch {pred_sha} != {ref_sha}")
|
| 131 |
-
|
| 132 |
-
if errors:
|
| 133 |
-
print("CONSISTENCY_CHECK=FAILED")
|
| 134 |
-
for item in errors:
|
| 135 |
-
print(item)
|
| 136 |
-
return 1
|
| 137 |
-
|
| 138 |
-
print("CONSISTENCY_CHECK=PASSED")
|
| 139 |
-
print(f"pred_jsonl={args.pred_jsonl.resolve()}")
|
| 140 |
-
print(f"reference_jsonl={args.reference_jsonl.resolve()}")
|
| 141 |
-
if args.pred_video is not None and args.reference_video is not None:
|
| 142 |
-
print(f"pred_video={args.pred_video.resolve()}")
|
| 143 |
-
print(f"reference_video={args.reference_video.resolve()}")
|
| 144 |
-
return 0
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
if __name__ == "__main__":
|
| 148 |
-
raise SystemExit(main())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|