Commit Graph

13 Commits (fce2e7f1b7e6d57f15cd4e4246aaa50f50bea967)

Author SHA1 Message Date
jingyaogong 21ec325dba [update] simplify safe math eval 2026-09-14 23:55:32 +08: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 101d7df2da [update] minimind-3 2026-03-25 23:57:45 +08:00
jingyaogong e119db8478 [fix] compile unpack 2026-01-14 20:13:32 +08:00
jingyaogong df89069362 [update] params log 2026-01-07 23:08:45 +08:00
jingyaogong 9236260a4a [feat] get params 2025-12-31 20:46:59 +08:00
jingyaogong 288a1d7212 [feat] get params 2025-12-31 20:44:34 +08:00
jingyaogong 7eae14f3ce [feat] remove empty_cache 2025-12-27 07:14:36 +08:00
jingyaogong 5129f0e2a2 [fix] dtype & lr 2025-12-09 13:01:38 +08:00
dyhuachi bf3878ace8
[fix] Refactor get_lr function to include min_lr calculation
这里的退火算法会让参数里的lr的起始值变成原来lr的1.1倍,作出如下修改
2025-12-06 17:09:51 +08:00
jingyaogong 5e1447b913 [fix] cuda memory #559 2025-12-01 16:17:43 +08:00
jingyaogong 0323815729 [feat] update import 2025-10-31 23:45:55 +08:00
jingyaogong e8484874f5 [feat] pause-training 2025-10-26 18:49:52 +08:00