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(train): initialize target in target_from_expected to avoid UnboundLocalError (#887)

Swatantra Yadav77519e6caa02
diff --git a/laya/train.py b/laya/train.py
index c29cf9c0..37199cbe 100644
--- a/laya/train.py
+++ b/laya/train.py
@@ -173,6 +173,7 @@ def target_from_expected(q: Dict[str, Any], expected_val: Any,
t, crit = q["t"], q["crit"]
k = len(render_options(q))
idx = None
+ target = None
if t == "choice":
keys = list(crit.keys())