Image-Text-to-Text
Transformers
Safetensors
qwen3_5
vllm
video
multimodal
reinforcement-learning
temporal-grounding
object-tracking
video-segmentation
visual-question-answering
spatial-reasoning
qwen3.5
conversational
Instructions to use OraRL/Video-ORA-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OraRL/Video-ORA-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OraRL/Video-ORA-9B") 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("OraRL/Video-ORA-9B") model = AutoModelForMultimodalLM.from_pretrained("OraRL/Video-ORA-9B", 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 OraRL/Video-ORA-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OraRL/Video-ORA-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OraRL/Video-ORA-9B", "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/OraRL/Video-ORA-9B
- SGLang
How to use OraRL/Video-ORA-9B 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 "OraRL/Video-ORA-9B" \ --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": "OraRL/Video-ORA-9B", "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 "OraRL/Video-ORA-9B" \ --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": "OraRL/Video-ORA-9B", "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 OraRL/Video-ORA-9B with Docker Model Runner:
docker model run hf.co/OraRL/Video-ORA-9B
| from __future__ import annotations | |
| import sys | |
| from pathlib import Path | |
| import pytest | |
| import yaml | |
| RELEASE_ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(RELEASE_ROOT)) | |
| from orarl.cli import train # noqa: E402 | |
| def _inputs(tmp_path: Path, method: str = "orarl") -> list[str]: | |
| config = tmp_path / "config.yaml" | |
| if method == "orarl": | |
| config_text = ( | |
| "data:\n" | |
| " rollout_batch_size: 64\n" | |
| "algorithm:\n" | |
| " name: orarl\n" | |
| " selection_prune_ratio: 0.5\n" | |
| " selection_positive_quota: 1\n" | |
| " selection_negative_quota: 2\n" | |
| "worker:\n" | |
| " rollout:\n" | |
| " n: 8\n" | |
| ) | |
| else: | |
| config_text = f"algorithm:\n name: {method}\n" | |
| config.write_text(config_text, encoding="utf-8") | |
| model = tmp_path / "model" | |
| model.mkdir() | |
| train_data = tmp_path / "train.jsonl" | |
| train_data.write_text("{}\n", encoding="utf-8") | |
| val_data = tmp_path / "val.jsonl" | |
| val_data.write_text("{}\n", encoding="utf-8") | |
| return [ | |
| "--config", | |
| str(config), | |
| "--model", | |
| str(model), | |
| "--train-data", | |
| str(train_data), | |
| "--val-data", | |
| str(val_data), | |
| "--output", | |
| str(tmp_path / "output"), | |
| "--nodes", | |
| "2", | |
| "--gpus", | |
| "4", | |
| "--python", | |
| sys.executable, | |
| ] | |
| def test_train_command_uses_full_config_and_explicit_overrides(tmp_path: Path) -> None: | |
| parser = train.create_parser() | |
| namespace = parser.parse_args(_inputs(tmp_path)) | |
| command, method = train.build_command(namespace) | |
| assert method == "orarl" | |
| assert namespace.dry_run is True | |
| assert command[:3] == [sys.executable, "-m", "verl.trainer.main"] | |
| assert f"config={(tmp_path / 'config.yaml').resolve()}" in command | |
| assert f"worker.actor.model.model_path={(tmp_path / 'model').resolve()}" in command | |
| assert f"data.train_files={(tmp_path / 'train.jsonl').resolve()}" in command | |
| assert f"data.val_files={(tmp_path / 'val.jsonl').resolve()}" in command | |
| assert f"trainer.save_checkpoint_path={(tmp_path / 'output').resolve()}" in command | |
| assert "trainer.nnodes=2" in command | |
| assert "trainer.n_gpus_per_node=4" in command | |
| def test_train_resolves_bundled_config_name(tmp_path: Path) -> None: | |
| arguments = _inputs(tmp_path) | |
| arguments[arguments.index("--config") + 1] = "orarl_4b.yaml" | |
| namespace = train.create_parser().parse_args(arguments) | |
| command, method = train.build_command(namespace) | |
| assert method == "orarl" | |
| assert f"config={train.config_path('orarl_4b.yaml')}" in command | |
| def test_orarl_dry_run_rejects_incompatible_world_size(tmp_path: Path) -> None: | |
| arguments = _inputs(tmp_path) | |
| arguments[arguments.index("--nodes") + 1] = "1" | |
| arguments[arguments.index("--gpus") + 1] = "6" | |
| namespace = train.create_parser().parse_args(arguments) | |
| with pytest.raises(train.CliError, match="selected batch must divide"): | |
| train.build_command(namespace) | |
| def test_orarl_dry_run_validates_batch_override(tmp_path: Path) -> None: | |
| arguments = [ | |
| *_inputs(tmp_path), | |
| "--set", | |
| "data.rollout_batch_size=66", | |
| ] | |
| namespace = train.create_parser().parse_args(arguments) | |
| with pytest.raises(train.CliError, match="append-oracle batch must divide"): | |
| train.build_command(namespace) | |
| def test_train_rejects_missing_required_path(tmp_path: Path) -> None: | |
| arguments = _inputs(tmp_path) | |
| arguments[arguments.index("--model") + 1] = str(tmp_path / "missing") | |
| namespace = train.create_parser().parse_args(arguments) | |
| with pytest.raises(train.CliError, match="model does not exist"): | |
| train.build_command(namespace) | |
| def test_protected_overrides_use_dedicated_options(tmp_path: Path) -> None: | |
| arguments = _inputs(tmp_path) + ["--set", "data.train_files=other.jsonl"] | |
| namespace = train.create_parser().parse_args(arguments) | |
| with pytest.raises(train.CliError, match="dedicated option"): | |
| train.build_command(namespace) | |
| def test_public_configs_expose_final_recipe() -> None: | |
| grpo_4b = yaml.safe_load((RELEASE_ROOT / "configs" / "grpo_4b.yaml").read_text()) | |
| grpo_9b = yaml.safe_load((RELEASE_ROOT / "configs" / "grpo_9b.yaml").read_text()) | |
| recipe_4b = yaml.safe_load((RELEASE_ROOT / "configs" / "orarl_4b.yaml").read_text()) | |
| recipe_9b = yaml.safe_load((RELEASE_ROOT / "configs" / "orarl_9b.yaml").read_text()) | |
| for config in (grpo_4b, grpo_9b): | |
| assert config["algorithm"]["name"] == "grpo" | |
| assert config["data"]["group_by_task"] is True | |
| assert config["data"]["rollout_batch_size"] == ("${oc.env:ORARL_ROLLOUT_BATCH_SIZE,64}") | |
| assert config["worker"]["actor"]["global_batch_size"] == ( | |
| "${oc.env:ORARL_GLOBAL_BATCH_SIZE,64}" | |
| ) | |
| assert config["worker"]["rollout"]["n"] == 8 | |
| assert config["trainer"]["logger"] == ["console"] | |
| assert grpo_9b["worker"]["actor"]["micro_batch_size_per_device_for_update"] == ( | |
| "${oc.env:ORARL_UPDATE_MICRO_BATCH,1}" | |
| ) | |
| assert grpo_9b["worker"]["actor"]["optim"]["lr"] == ("${oc.env:ORARL_LEARNING_RATE,1.0e-6}") | |
| for config in (recipe_4b, recipe_9b): | |
| algorithm = config["algorithm"] | |
| assert algorithm["name"] == "orarl" | |
| assert algorithm["oracle_injection_mode"] == "append" | |
| assert algorithm["scale_rewards"] is False | |
| assert algorithm["directional_gain"] is True | |
| assert algorithm["directional_gain_gamma"] == 0.25 | |
| assert algorithm["directional_gain_positive_only"] is True | |
| assert algorithm["directional_gain_recenter"] is True | |
| assert algorithm["detached_oracle_advantage_scale"] == 2.0 | |
| assert algorithm["detached_oracle_use_directional_gain"] is False | |
| assert algorithm["detached_oracle_match_best_ratio"] == 1.2 | |
| assert algorithm["detached_oracle_match_best_min"] == 0.05 | |
| assert algorithm["detached_oracle_match_best_max"] == 1.0 | |
| assert algorithm["oracle_reward_gate_beta"] == 2.0 | |
| assert algorithm["selection_prune_ratio"] == 0.5 | |
| assert algorithm["selection_positive_quota"] == 1 | |
| assert algorithm["selection_negative_quota"] == 2 | |
| assert algorithm["selection_strict_sign_balance"] is True | |
| assert algorithm["post_selection_recenter"] is True | |
| assert algorithm["post_selection_rms_match"] is True | |
| assert algorithm["post_selection_rms_min_scale"] == 0.25 | |
| assert algorithm["disable_kl"] is True | |
| assert config["data"]["group_by_task"] is True | |
| assert config["data"]["rollout_batch_size"] == ("${oc.env:ORARL_ROLLOUT_BATCH_SIZE,64}") | |
| assert config["worker"]["actor"]["global_batch_size"] == ( | |
| "${oc.env:ORARL_GLOBAL_BATCH_SIZE,64}" | |
| ) | |
| assert config["worker"]["rollout"]["n"] == 8 | |
| assert config["trainer"]["logger"] == ["console"] | |