Datasets:
Download adapters/example_adapter.py from XinNUS/DOVE-Bench: direct link, hf CLI and curl.
- Browser
- Download file 801 Bytes
-
https://huggingface.co/datasets/XinNUS/DOVE-Bench/resolve/main/adapters/example_adapter.py
- Command line
-
hf download hf://datasets/XinNUS/DOVE-Bench/adapters/example_adapter.py
-
curl -L -o example_adapter.py https://huggingface.co/datasets/XinNUS/DOVE-Bench/resolve/main/adapters/example_adapter.py
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 | |