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.
Python calibrationclassificationdecision-modelhuggingfacejevmodernbertmultilingualnlppythonpytorchroutingtyped-decisionszero-shot
fix(agent): remove redundant exception handling for OutOfMemoryError
Lim, Xiang Yang9631e9776305
diff --git a/laya/agent.py b/laya/agent.pyindex d28040ef..a10d9c04 100644--- a/laya/agent.py+++ b/laya/agent.py@@ -423,7 +423,7 @@ class Agent(HookRegistry):fell_back_from = fell_back_why = Nonetry:self.model.to(self.device).eval()- except (RuntimeError, torch.cuda.OutOfMemoryError, torch.OutOfMemoryError) as e:+ except (RuntimeError, torch.cuda.OutOfMemoryError) as e:if self.device.type != "cpu":# Record what actually went wrong: the reason matters more than the symptom,# and it is the only place the underlying exception is ever surfaced.@@ -633,8 +633,7 @@ class Agent(HookRegistry):try:return run()- except (RuntimeError, torch.cuda.OutOfMemoryError, torch.OutOfMemoryError) as e:- # torch.OutOfMemoryError (not the CUDA subclass) is what XPU OOMs raise+ except (RuntimeError, torch.cuda.OutOfMemoryError) as e:low = str(e).lower()if self.device.type != "cpu" and ("memory" in low or "cuda" in low):print("Warning: GPU memory exceeded during inference. Falling back to CPU...")