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.

Merge pull request #810 from Swatantra-66/fix/concurrent-gpu-oom-fallback

Nandakishore54b34002b00
diff --cc tests/test_agent_gate.py
index 33f862fe,d9c014c2..09d69fe0
--- a/tests/test_agent_gate.py
+++ b/tests/test_agent_gate.py
@@@ -16,14 -16,13 +16,16 @@@ import type
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, ROOT)
- if "torch" not in sys.modules:
+ try:
+ import torch
+ except ImportError:
t = types.ModuleType("torch")
- t.cuda = types.ModuleType("torch.cuda")
- t.cuda.OutOfMemoryError = type("OutOfMemoryError", (RuntimeError,), {})
+ # laya/common.py annotates `proper_reward` with both at module scope, so importing
+ # laya.agent through this stub needs them present even though no test touches a tensor.
t.Tensor = type("Tensor", (), {})
+ t.dtype = type("dtype", (), {})
+ t.cuda = types.ModuleType("torch.cuda")
+ t.cuda.OutOfMemoryError = type("OutOfMemoryError", (RuntimeError,), {})
t.nn = types.ModuleType("torch.nn")
t.nn.Module = type("Module", (), {})
t.nn.MultiheadAttention = type("MultiheadAttention", (), {})