Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

fix(agent): hold the tokenizer lock while predict_long encodes the state

abhijithneilabrahama7807940756c
diff --git a/laya/agent.py b/laya/agent.py
index 82342ade..b79429d5 100644
--- a/laya/agent.py
+++ b/laya/agent.py
@@ -1561,8 +1561,8 @@ class Agent(HookRegistry):
budget, step, _ = window_budget(self.tok, [internal[qid] for qid in ids], max_len,
head_max_len, window=window, stride=stride)
- state_ids = self.tok(serialize_state(state).replace(self.tok.mask_token, " "),
- add_special_tokens=False)["input_ids"]
+ state_ids = encode_text(self.tok, serialize_state(state).replace(self.tok.mask_token, " "),
+ add_special_tokens=False)["input_ids"]
# Fits in one window: identical to a plain call, no windowing overhead. `windows` is still
# written, so the key is total over the three paths this method can take and a caller can
# ask "how much of the document did the model read?" without handling a KeyError on the