Datasets:
File size: 801 Bytes
92186b3 | 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 | """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
|