mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
server: drop the thinking-hold check on an engine's "multi" attribute
The reasoning-budget hold was skipped for an engine with a nonzero `multi`, a value the engine's READY line used to set. That line is no longer parsed and nothing sets the attribute, so `not getattr(self.engine, "multi", 0)` is always true. The check goes, with the comment words about it and the test stub's `multi` field. The test that set `engine.multi = 2` now only checks what its name already said: a READY holdb without --batch changes nothing, and the first pass carries the hold. No behaviour change: every real engine took the hold before and takes it now.
This commit is contained in:
1 parent
ab38d9298a
commit
02020478b8
2 files changed
+4
-6
No files matched your search
+1
-2
@@ -6371,11 +6371,10 @@ class Service:
|
||||
last_print = time.time()
|
||||
prompt, thought = ids, 0 # thought: the reasoning tokens so far (the budget's count)
|
||||
# the engine stops at the budget itself (HOLD_KEY), when it can and </think> is one token: a --batch engine
|
||||
# only when its slots say they hold too (READY holdb); a multi engine takes no hold
|
||||
# only when its slots say they hold too (READY holdb)
|
||||
hold_end = None
|
||||
if (budget and getattr(self.engine, "can_hold", False) is True
|
||||
and (not getattr(self.engine, "batch", 0) or getattr(self.engine, "can_hold_batch", False) is True)
|
||||
and not getattr(self.engine, "multi", 0)
|
||||
and getattr(self.engine, "split_engine", False) is not True): # (the split engine's parser refuses the key: tests/split/test_split_gen_keys.py)
|
||||
te = self.tok.encode(THINK_END, parse_special=True)
|
||||
hold_end = te[0] if len(te) == 1 else None
|
||||
|
||||
@@ -36,7 +36,7 @@ class WindowEngine:
|
||||
self.windows, self.overrun = windows, overrun
|
||||
self.can_hold, self.honours_hold = can_hold, honours_hold
|
||||
self.can_hold_batch = can_hold_batch # READY says holdb: the --batch slots end at the hold too (P2b)
|
||||
self.batch = self.multi = 0
|
||||
self.batch = 0
|
||||
self.thought = thought if thought is not None else self.THOUGHT
|
||||
self.start = tok.encode("<|im_start|>", parse_special=True)[0]
|
||||
self.think_end = tok.encode("</think>", parse_special=True)[0]
|
||||
@@ -257,11 +257,10 @@ class ThinkingHold(HoldCase):
|
||||
wrap = len(self.tok.encode(REASONING_WRAP_UP, parse_special=True))
|
||||
self.assertEqual((passes[1]["reused"], passes[1]["read"]), (passes[0]["prompt"] + 20 - 1, 1 + wrap))
|
||||
|
||||
def test_holdb_does_not_matter_without_batch_and_a_multi_engine_gets_none(self):
|
||||
def test_holdb_does_not_matter_without_batch(self):
|
||||
self.start(can_hold_batch=True)
|
||||
self.engine.multi = 2
|
||||
self.assertEqual(self.chat(reasoning_budget_tokens=20), self.expected(20))
|
||||
self.assertTrue(all(p["hold"] is None for p in self.engine.passes))
|
||||
self.assertEqual(self.engine.passes[0]["hold"], (20, self.tok.encode("</think>", parse_special=True)[0]))
|
||||
|
||||
|
||||
class SamplerObject(HoldCase):
|
||||
|
||||
Reference in new issue
Block a user