Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tts-ranking
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
audio
tts-ranking
Commits
9a04eac8
Commit
9a04eac8
authored
Jul 11, 2026
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(luna-tts): never vote for competitor side in random fallback
parent
0adcdbce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
server/strategy.py
+6
-2
No files found.
server/strategy.py
View file @
9a04eac8
...
@@ -91,7 +91,11 @@ def decide(left: SideResult, right: SideResult, threshold: float = 0.80) -> Deci
...
@@ -91,7 +91,11 @@ def decide(left: SideResult, right: SideResult, threshold: float = 0.80) -> Deci
if
right_is_comp
:
if
right_is_comp
:
return
Decision
(
action
=
"vote_left"
,
return
Decision
(
action
=
"vote_left"
,
reason
=
f
"right 最高分为竞品 {right.top_speaker}({right.top_score:.4f}) → 投 left"
)
reason
=
f
"right 最高分为竞品 {right.top_speaker}({right.top_score:.4f}) → 投 left"
)
# Neither competitor — random
# Neither competitor qualifies → pick non-competitor side, random if both ok
side
=
random
.
choice
([
left
,
right
])
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}"
,
return
Decision
(
action
=
f
"vote_{side.label}"
,
reason
=
f
"双方无我方/大厂/竞品 ≥ {threshold} → 随机投{side.label}"
)
reason
=
f
"双方无我方/大厂/竞品 ≥ {threshold} → 随机投{side.label}"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment