Commit Graph

4 Commits (cd36b4a0137490b31cfe535ba8cdb3869a44c457)

Author SHA1 Message Date
YoungjuKim cd36b4a013
[fix] decide native-vs-transformers loading by directory name, not substring
"model" in args.load_from matched any path containing "model" (for
example a Hugging Face cache path or /data/models/...), so the scripts
loaded ./out/*.pth instead of the transformers checkpoint the user
passed. Compare the last path component with "model" instead.

Signed-off-by: YoungjuKim <fjvbn2003@gmail.com>
2026-10-17 03:53:56 +09:00
tkgcc 0f6803e551 [fix] replace tool eval() with an AST math evaluator
execute_tool() relied on signal.SIGALRM, which does not exist on Windows.
The AttributeError was swallowed by a bare except, so every tool call
silently returned None and the model always observed
{"error": "tool not found"} (issue #846).

calculate_math also ran eval() on model-generated text. Two of the three
call sites (scripts/eval_toolcall.py, scripts/web_demo.py) passed no
globals at all, leaving full builtins reachable from sampled output.

safe_math_eval() in trainer_utils.py parses the expression with ast and
walks it, allowing only arithmetic operators and a math whitelist, with
caps on expression length and exponent size. It cannot loop forever, so
the signal-based timeout is no longer needed and is removed. Both sqrt(x)
and math.sqrt(x) spellings keep working.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 07:53:33 +08:00
jingyaogong 6b0b0c5e2f [update] fp16 inference 2026-03-27 16:29:46 +08:00
jingyaogong 101d7df2da [update] minimind-3 2026-03-25 23:57:45 +08:00