Run this model with HF Jobs
Run XiangnanW/CGVM-R2.6-Qwen3VL-8B-step600 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/XiangnanW/CGVM-R2.6-Qwen3VL-8B-step600. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/XiangnanW/CGVM-R2.6-Qwen3VL-8B-step600 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use XiangnanW/CGVM-R2.6-Qwen3VL-8B-step600 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use XiangnanW/CGVM-R2.6-Qwen3VL-8B-step600 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
File size: 4,782 Bytes
4ad9219 | 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 | """官方 BT/RT 与外部时序/动作基准(TempCompass / MotionBench / VideoMME / LongVideoBench)统一题单读取与评分适配。"""
import collections
import json
from pathlib import Path
import sys
ROOT = Path(__file__).resolve().parents[1]
BT_TASKS = ('EPM', 'ASI', 'HLD')
RT_TASKS = ('OCR', 'ACR', 'ATR', 'STU', 'FPD', 'OJR')
# 外部 benchmark:题单已归一化为 2~5 选项单选。
EXT_BENCHMARKS = ('tempcompass', 'videomme', 'longvideobench', 'motionbench')
def questions(benchmark):
ext_manifest = ROOT / 'manifests' / f'{benchmark}_questions.jsonl'
if benchmark in EXT_BENCHMARKS and ext_manifest.exists():
rows = [json.loads(line) for line in ext_manifest.read_text().splitlines() if line.strip()]
else:
rows = [json.loads(line) for line in (ROOT / 'manifests/eval_questions.jsonl').read_text().splitlines() if line.strip()]
result = []
for item in rows:
if item['benchmark'] != benchmark:
continue
source = item['annotation']
if benchmark == 'ovobench':
row = dict(id=str(source['id']), video=source['video'], timestamp=float(source['realtime']),
question=source['question'].strip(), options=source['options'],
answer=chr(65 + source['gt']), task=source['task'], benchmark=benchmark)
elif benchmark in EXT_BENCHMARKS:
# 外部 benchmark 的 annotation 已含 question/options/answer(字母)/task;
# 题目在整段视频观测完毕后提出,因此 timestamp = query_time = 视频时长。
row = dict(source)
row.update(id=str(source['id']), benchmark=benchmark,
question=str(source['question']).strip(),
options=[str(o) for o in source['options']],
answer=str(source['answer']).strip().upper(),
task=str(source.get('task', 'default')),
timestamp=float(item['query_time']))
else:
row = dict(source)
row.update(source_video=item['source_video'], query_time=float(item['query_time']))
result.append(row)
if len({r['id'] for r in result}) != len(result):
raise RuntimeError('官方题目ID不唯一')
return result
def groups(benchmark, shard=0, shards=1, require_media=True):
# 按源视频互斥分片;同视频所有提问按真实时间推进,不能按题分片重复建库。
grouped = collections.defaultdict(list)
for q in questions(benchmark):
grouped[q['source_video']].append(q)
from cgvm.sources import source_plan
sources, _, _ = source_plan(benchmark)
result = {}
for index, video in enumerate(sorted(grouped)):
if index % shards != shard:
continue
path = ROOT / sources[video]['path']
if require_media and not path.exists():
raise FileNotFoundError('正式评测缺媒体,不得缩小题单:' + str(path))
result[str(path)] = sorted(grouped[video], key=lambda q: (q['timestamp'], q['id']))
return result
def official_score(q, raw):
if raw is None:
return False
if q['benchmark'] in EXT_BENCHMARKS:
# 官方评分:首个非空字符必须等于答案字母(与 StreamingBench count.py 同规则;answer=NA 返回 False,统计时按有效标签过滤)。
ans = str(q['answer']).strip().upper()
if ans not in ('A', 'B', 'C', 'D', 'E'):
return False
text = str(raw).strip()
return bool(text) and text[0].upper() == ans
if q['benchmark'] == 'ovobench':
sys.path.insert(0, str(ROOT / 'repos/OVO-Bench'))
from utils.OVOBenchScore import OVOBenchOfflineScore
results, _ = OVOBenchOfflineScore(None, None).calculate_score_backward_realtime([
dict(response=raw, ground_truth=q['answer'], task=q['task'])])
return bool(results[0]['score'])
# 官方 StreamingBench count.py 按原始第一个字符比较;保留空/失败题在分母内。
return bool(raw) and raw[0] == q['answer']
def diagnostic_scores(q, raw):
sys.path.insert(0, str(ROOT / 'repos/MEMO'))
try:
from memo.benchmarks.scoring import score_answer
strict_choice, strict = score_answer(q, raw or '', 'strict')
legacy_choice, legacy = score_answer(q, raw or '', 'legacy')
except Exception:
# 外部 benchmark 的 2/3/5 选项题不适用 MEMO 四选项诊断,主口径为 official_correct。
strict_choice = strict = legacy_choice = legacy = None
return dict(official_correct=official_score(q, raw), strict_choice=strict_choice, strict_correct=strict,
memo_legacy_choice=legacy_choice, memo_legacy_correct=legacy)
|