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
File size: 5,629 Bytes
53c10a4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | from __future__ import annotations
import importlib.util
import sys
import types
from dataclasses import fields, is_dataclass
from pathlib import Path
import yaml
RELEASE_ROOT = Path(__file__).resolve().parents[1]
RUNTIME_ROOT = RELEASE_ROOT / "verl"
sys.path.insert(0, str(RELEASE_ROOT))
def _package(name: str, path: Path) -> types.ModuleType:
module = types.ModuleType(name)
module.__path__ = [str(path)] # type: ignore[attr-defined]
return module
def _load_module(
name: str,
path: Path,
monkeypatch,
) -> types.ModuleType:
spec = importlib.util.spec_from_file_location(name, path)
assert spec is not None and spec.loader is not None
module = importlib.util.module_from_spec(spec)
monkeypatch.setitem(sys.modules, name, module)
spec.loader.exec_module(module)
return module
def test_runtime_loads_public_reward_module(monkeypatch) -> None:
"""The public module:function config must survive runtime initialization."""
verl_root = RUNTIME_ROOT
reward_root = verl_root / "workers" / "reward"
monkeypatch.setitem(sys.modules, "verl", _package("verl", verl_root))
monkeypatch.setitem(
sys.modules,
"verl.workers",
_package("verl.workers", verl_root / "workers"),
)
monkeypatch.setitem(
sys.modules,
"verl.workers.reward",
_package("verl.workers.reward", reward_root),
)
functional = types.ModuleType("verl.utils.py_functional")
functional.get_abs_path = lambda value, **_: str(Path(value).resolve())
monkeypatch.setitem(
sys.modules,
"verl.utils",
_package("verl.utils", verl_root / "utils"),
)
monkeypatch.setitem(sys.modules, "verl.utils.py_functional", functional)
protocol = types.ModuleType("verl.protocol")
protocol.DataProto = object
monkeypatch.setitem(sys.modules, "verl.protocol", protocol)
torch = types.ModuleType("torch")
torch.Tensor = object
monkeypatch.setitem(sys.modules, "torch", torch)
transformers = types.ModuleType("transformers")
transformers.PreTrainedTokenizer = object
monkeypatch.setitem(sys.modules, "transformers", transformers)
config_module = _load_module(
"verl.workers.reward.config",
reward_root / "config.py",
monkeypatch,
)
function_module = _load_module(
"verl.workers.reward.function",
reward_root / "function.py",
monkeypatch,
)
config = config_module.RewardConfig(
reward_function="orarl.rewards:compute_score",
)
config.post_init()
assert config.reward_function == "orarl.rewards"
assert config.reward_function_name == "compute_score"
assert config.reward_function_is_module is True
manager = function_module.AutoRewardManager(config, tokenizer=object())
scores = manager.reward_fn(
[
{
"problem_type": "video_qa_mc",
"ground_truth": "<answer>A</answer>",
"response": "<answer>A</answer>",
}
]
)
assert scores[0]["overall"] == 1.0
def _assert_config_keys(config: object, payload: dict, path: str = "") -> None:
known = {item.name for item in fields(config)}
unknown = sorted(set(payload) - known)
assert not unknown, f"{path or '<root>'} has unknown fields: {unknown}"
for key, value in payload.items():
child = getattr(config, key)
if isinstance(value, dict) and is_dataclass(child):
_assert_config_keys(child, value, f"{path}.{key}".strip("."))
def test_public_recipes_match_runtime_dataclasses(monkeypatch) -> None:
"""Every public YAML field must be accepted by the bundled runtime."""
verl_root = RUNTIME_ROOT
reward_root = verl_root / "workers" / "reward"
monkeypatch.setitem(sys.modules, "verl", _package("verl", verl_root))
monkeypatch.setitem(
sys.modules,
"verl.trainer",
_package("verl.trainer", verl_root / "trainer"),
)
monkeypatch.setitem(
sys.modules,
"verl.workers",
_package("verl.workers", verl_root / "workers"),
)
monkeypatch.setitem(
sys.modules,
"verl.workers.reward",
_package("verl.workers.reward", reward_root),
)
monkeypatch.setitem(
sys.modules,
"verl.utils",
_package("verl.utils", verl_root / "utils"),
)
functional = types.ModuleType("verl.utils.py_functional")
functional.get_abs_path = lambda value, **_: str(Path(value).resolve())
monkeypatch.setitem(sys.modules, "verl.utils.py_functional", functional)
multimodal_contract = types.ModuleType("verl.utils.multimodal_contract")
multimodal_contract.normalize_video_source_mode = lambda value, **_: value
monkeypatch.setitem(
sys.modules,
"verl.utils.multimodal_contract",
multimodal_contract,
)
reward_config_module = _load_module(
"verl.workers.reward.config",
reward_root / "config.py",
monkeypatch,
)
reward_package = sys.modules["verl.workers.reward"]
reward_package.RewardConfig = reward_config_module.RewardConfig
trainer_config_module = _load_module(
"verl.trainer.config",
verl_root / "trainer" / "config.py",
monkeypatch,
)
runtime_config = trainer_config_module.PPOConfig()
for name in (
"grpo_4b.yaml",
"grpo_9b.yaml",
"orarl_4b.yaml",
"orarl_9b.yaml",
):
payload = yaml.safe_load((RELEASE_ROOT / "configs" / name).read_text(encoding="utf-8"))
_assert_config_keys(runtime_config, payload)
|