From 6b306566b2f45780f9fd4fb548fe13164aeab4b5 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 6 Sep 2026 14:58:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(platform):=20=E8=83=BD=E5=8A=9B=E5=AE=88?= =?UTF-8?q?=E5=8D=AB=E6=AD=A7=E4=B9=89=E5=A4=84=E7=90=86=E2=80=94=E2=80=94?= =?UTF-8?q?'=E8=A7=86=E9=A2=91'=E5=AD=97=E5=9C=A8t2v=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E5=BF=85=E7=8E=B0=E4=B8=8D=E7=AE=97=E8=BE=93=E5=85=A5=E5=A3=B0?= =?UTF-8?q?=E6=98=8E;=E9=9F=B3=E9=A2=91=E5=8D=95=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E4=B8=8D=E8=87=AA=E5=8A=A8=E7=BA=A0=E6=AD=A3=E5=8F=AA=E8=AD=A6?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_platform/platform_ability.py | 43 +++++++++++++++------------ 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/pipeline_platform/platform_ability.py b/pipeline_platform/platform_ability.py index b506dbe..9f999c2 100644 --- a/pipeline_platform/platform_ability.py +++ b/pipeline_platform/platform_ability.py @@ -486,6 +486,8 @@ def _capability_guard(capability, description): 保守策略:只在「纯文本能力(t2v/t2i/t2t)+ 描述含媒体输入/参考声明」这种 铁证矛盾时纠正;其他不一致只警告不改(避免误伤描述措辞不规范的正确配置)。 + 歧义处理:"视频"二字在 t2v/i2v 描述里几乎必现(输出侧),不算输入声明; + 输入声明判据 = 参考词(参考生/全能参考/四模态等)或图像/音频词或输入媒体≥2类。 返回 (corrected_cap 或 None, warning 或 None)。 """ desc = description or '' @@ -493,26 +495,29 @@ def _capability_guard(capability, description): return None, None has_ref = any(w in desc for w in _DESC_REF_WORDS) kinds = [k for k, words in _DESC_MEDIA_WORDS.items() if any(w in desc for w in words)] - # 「输出 视频」的"视频"不算输入声明——t2v 描述几乎都带"视频"二字。 - # 输入声明判据:参考词,或图像/音频词(这两个不会出现在纯文本生成的描述里), - # 或"视频"以外多模态组合。 input_kinds = [k for k in kinds if k != 'video'] - if has_ref or len(input_kinds) >= 1 or (has_ref is False and len(kinds) >= 2 and 'video' in kinds and input_kinds): - out_word = '视频' if capability == 't2v' else ('图像' if capability == 't2i' else '') - if capability == 't2t': - return None, ("描述含媒体输入声明(%s)但能力是 t2t——请人工核对能力分类" - % '/'.join(kinds)) - expected = 'r2v' if (has_ref or len(kinds) >= 2) else ( - 'i2v' if 'image' in input_kinds and out_word == '视频' else - ('i2i' if 'image' in input_kinds and out_word == '图像' else None)) - if expected and expected != capability: - return expected, ("能力自动纠正 %s→%s:描述声明媒体输入(%s%s)," - "纯文本能力与之矛盾(提取照示例误判,守卫按正文模态纠正)" - % (capability, expected, '/'.join(kinds), - ',含参考声明' if has_ref else '')) - return None, ("描述含媒体输入声明(%s)但能力是 %s——无法确定目标能力," - "请人工核对(可用 overrides.model_capability 纠正)" - % ('/'.join(kinds), capability)) + if not (has_ref or input_kinds): + return None, None + if capability == 't2t': + return None, ("描述含媒体输入声明(%s%s)但能力是 t2t——请人工核对能力分类" + % ('/'.join(kinds), ',含参考声明' if has_ref else '')) + out_word = '视频' if capability == 't2v' else '图像' + expected = None + if has_ref: + expected = 'r2v' if capability == 't2v' else 'i2i' + elif len(input_kinds) >= 2: + expected = 'r2v' if capability == 't2v' else 'i2i' + elif 'image' in input_kinds: + expected = 'i2v' if capability == 't2v' else 'i2i' + elif 'audio' in input_kinds: + # 音频输入语义不定(r2v 音频参考 / asr / tts 反向),不敢自动纠正 + return None, ("描述含音频输入声明但能力是 %s——无法确定目标能力," + "请人工核对(可用 overrides.model_capability 纠正)" % capability) + if expected and expected != capability: + return expected, ("能力自动纠正 %s→%s:描述声明媒体输入(%s%s)," + "纯文本能力与之矛盾(提取照示例误判,守卫按正文模态纠正)" + % (capability, expected, '/'.join(kinds), + ',含参考声明' if has_ref else '')) return None, None