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
Simplify quick start prompt inputs to direct strings only
Browse files- quick_start/README.md +4 -4
- quick_start/run_example.py +3 -28
quick_start/README.md
CHANGED
|
@@ -25,21 +25,21 @@ python quick_start/run_example.py \
|
|
| 25 |
--task-instruction "把洋葱放进快递箱里。"
|
| 26 |
```
|
| 27 |
|
| 28 |
-
If you have a more detailed task plan, pass it as text
|
| 29 |
|
| 30 |
```bash
|
| 31 |
python quick_start/run_example.py \
|
| 32 |
--video-path /path/to/video.mp4 \
|
| 33 |
--task-instruction "将三角烧杯放在三脚架上。" \
|
| 34 |
-
--task-plan
|
| 35 |
```
|
| 36 |
|
| 37 |
-
If you want full control over the prompt, pass it directly:
|
| 38 |
|
| 39 |
```bash
|
| 40 |
python quick_start/run_example.py \
|
| 41 |
--video-path /path/to/video.mp4 \
|
| 42 |
-
--prompt
|
| 43 |
```
|
| 44 |
|
| 45 |
If the model directory is not the parent of `quick_start/`, pass it explicitly:
|
|
|
|
| 25 |
--task-instruction "把洋葱放进快递箱里。"
|
| 26 |
```
|
| 27 |
|
| 28 |
+
If you have a more detailed task plan, pass it directly as text:
|
| 29 |
|
| 30 |
```bash
|
| 31 |
python quick_start/run_example.py \
|
| 32 |
--video-path /path/to/video.mp4 \
|
| 33 |
--task-instruction "将三角烧杯放在三脚架上。" \
|
| 34 |
+
--task-plan $'爪夹准备移动:0%\n爪夹开始移动:10%\n爪夹靠近三角烧杯:20%\n爪夹抓取三角烧杯:40%\n爪夹合拢并靠近三脚架:60%\n爪夹移动到三脚架的正上方:80%\n爪夹松开,三角烧杯落在三脚架上:100%'
|
| 35 |
```
|
| 36 |
|
| 37 |
+
If you want full control over the prompt, pass it directly as text:
|
| 38 |
|
| 39 |
```bash
|
| 40 |
python quick_start/run_example.py \
|
| 41 |
--video-path /path/to/video.mp4 \
|
| 42 |
+
--prompt $'任务描述和具体规划: 把洋葱放进快递箱里。\n开始移动:0%\n爪夹靠近洋葱:20%\n爪夹抓取洋葱:40%\n爪夹抓住洋葱接近快递箱:60%\n爪夹将洋葱放入快递箱:80%\n爪夹松开,洋葱落入快递箱:100%\n\n请根据任务描述和具体规划,找到并逐点生成视频中的关键动作点和相应的进度标注。输出格式要求:每个关键点一行,格式为:\n时间: X.Xs, 进度: Y%\n\n请严格按照上述格式输出,不要输出额外说明。'
|
| 43 |
```
|
| 44 |
|
| 45 |
If the model directory is not the parent of `quick_start/`, pass it explicitly:
|
quick_start/run_example.py
CHANGED
|
@@ -59,24 +59,12 @@ def parse_args() -> argparse.Namespace:
|
|
| 59 |
default=None,
|
| 60 |
help="Optional task plan text appended after the task instruction.",
|
| 61 |
)
|
| 62 |
-
parser.add_argument(
|
| 63 |
-
"--task-plan-file",
|
| 64 |
-
type=Path,
|
| 65 |
-
default=None,
|
| 66 |
-
help="Optional file containing task plan text.",
|
| 67 |
-
)
|
| 68 |
parser.add_argument(
|
| 69 |
"--prompt",
|
| 70 |
type=str,
|
| 71 |
default=None,
|
| 72 |
help="Optional full prompt override. If set, task instruction and plan are ignored.",
|
| 73 |
)
|
| 74 |
-
parser.add_argument(
|
| 75 |
-
"--prompt-file",
|
| 76 |
-
type=Path,
|
| 77 |
-
default=None,
|
| 78 |
-
help="Optional file containing the full prompt override.",
|
| 79 |
-
)
|
| 80 |
parser.add_argument(
|
| 81 |
"--sample-hz",
|
| 82 |
type=float,
|
|
@@ -98,19 +86,6 @@ def parse_args() -> argparse.Namespace:
|
|
| 98 |
return parser.parse_args()
|
| 99 |
|
| 100 |
|
| 101 |
-
def read_text_value(text_value: str | None, file_value: Path | None, *, field_name: str) -> str | None:
|
| 102 |
-
cli_name = field_name.replace("_", "-")
|
| 103 |
-
if text_value is not None and file_value is not None:
|
| 104 |
-
raise SystemExit(f"Only one of --{cli_name} and --{cli_name}-file may be set.")
|
| 105 |
-
if file_value is not None:
|
| 106 |
-
if not file_value.exists():
|
| 107 |
-
raise SystemExit(f"Missing {field_name} file: {file_value}")
|
| 108 |
-
return file_value.read_text(encoding="utf-8").strip()
|
| 109 |
-
if text_value is not None:
|
| 110 |
-
return text_value.strip()
|
| 111 |
-
return None
|
| 112 |
-
|
| 113 |
-
|
| 114 |
def load_metadata(metadata_path: Path | None) -> tuple[Path | None, dict[str, Any] | None]:
|
| 115 |
if metadata_path is None:
|
| 116 |
return None, None
|
|
@@ -148,8 +123,8 @@ def build_chunk_all_prompt(task_instruction: str, task_plan: str | None) -> str:
|
|
| 148 |
|
| 149 |
|
| 150 |
def resolve_prompt(args: argparse.Namespace, metadata: dict[str, Any] | None) -> tuple[str, str, str | None, str | None]:
|
| 151 |
-
prompt =
|
| 152 |
-
task_plan =
|
| 153 |
|
| 154 |
metadata_task_instruction = None
|
| 155 |
metadata_task_plan = None
|
|
@@ -168,7 +143,7 @@ def resolve_prompt(args: argparse.Namespace, metadata: dict[str, Any] | None) ->
|
|
| 168 |
|
| 169 |
if not task_instruction:
|
| 170 |
raise SystemExit(
|
| 171 |
-
"Either provide --prompt
|
| 172 |
"or provide --metadata-path with task_instruction."
|
| 173 |
)
|
| 174 |
|
|
|
|
| 59 |
default=None,
|
| 60 |
help="Optional task plan text appended after the task instruction.",
|
| 61 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
parser.add_argument(
|
| 63 |
"--prompt",
|
| 64 |
type=str,
|
| 65 |
default=None,
|
| 66 |
help="Optional full prompt override. If set, task instruction and plan are ignored.",
|
| 67 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
parser.add_argument(
|
| 69 |
"--sample-hz",
|
| 70 |
type=float,
|
|
|
|
| 86 |
return parser.parse_args()
|
| 87 |
|
| 88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
def load_metadata(metadata_path: Path | None) -> tuple[Path | None, dict[str, Any] | None]:
|
| 90 |
if metadata_path is None:
|
| 91 |
return None, None
|
|
|
|
| 123 |
|
| 124 |
|
| 125 |
def resolve_prompt(args: argparse.Namespace, metadata: dict[str, Any] | None) -> tuple[str, str, str | None, str | None]:
|
| 126 |
+
prompt = args.prompt.strip() if args.prompt else None
|
| 127 |
+
task_plan = args.task_plan.strip() if args.task_plan else None
|
| 128 |
|
| 129 |
metadata_task_instruction = None
|
| 130 |
metadata_task_plan = None
|
|
|
|
| 143 |
|
| 144 |
if not task_instruction:
|
| 145 |
raise SystemExit(
|
| 146 |
+
"Either provide --prompt, or provide --task-instruction, "
|
| 147 |
"or provide --metadata-path with task_instruction."
|
| 148 |
)
|
| 149 |
|