DOVE-Bench / adapters /example_adapter.py
XinNUS's picture
DOVE v1: 180 groups, 530 intervals, 1,223 human-verified probes
92186b3 verified
Raw History Blame Contribute Delete
801 Bytes
"""Minimal DOVE adapter template.
Copy this file and replace ``create_predictor`` with your model loader. The
returned callable receives one public question whose ``video`` is absolute.
It must return only the target-interval caption as a string.
"""
from __future__ import annotations
from typing import Any, Callable
def create_predictor(model_args: dict[str, Any]) -> Callable[[dict[str, Any]], str]:
# Load tokenizer/model once here. Values passed with --model-args are
# available in model_args.
del model_args
def predict(question: dict[str, Any]) -> str:
video_path = question["video"]
prompt = question["prompt"]
raise NotImplementedError(
f"Run your model on video={video_path!r} with prompt={prompt!r}"
)
return predict