Commit 9a04eac8 by 程裕兵

fix(luna-tts): never vote for competitor side in random fallback

parent 0adcdbce
......@@ -91,7 +91,11 @@ def decide(left: SideResult, right: SideResult, threshold: float = 0.80) -> Deci
if right_is_comp:
return Decision(action="vote_left",
reason=f"right 最高分为竞品 {right.top_speaker}({right.top_score:.4f}) → 投 left")
# Neither competitor — random
side = random.choice([left, right])
# Neither competitor qualifies → pick non-competitor side, random if both ok
non_comp_sides = [s for s in (left, right) if s.top_library != "competitor"]
if not non_comp_sides:
return Decision(action="skip",
reason="双方最高分都来自竞品库 → 弃权")
side = random.choice(non_comp_sides)
return Decision(action=f"vote_{side.label}",
reason=f"双方无我方/大厂/竞品 ≥ {threshold} → 随机投{side.label}")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment