unsloth/studio/backend
Daniel Han 8582ce3e9c
Fix studio chat crash on Mac: vendor check_signal_escape_patterns (#4431)
* Fix studio crash on Mac: vendor check_signal_escape_patterns from unsloth_zoo

Vendor the `check_signal_escape_patterns` function from
`unsloth_zoo.rl_environments` directly into `tools.py`. The function is
pure Python (only uses stdlib `ast`) and has zero GPU dependencies, but
importing it from unsloth_zoo triggers `unsloth_zoo.__init__` which calls
`get_device_type()` at module scope -- raising NotImplementedError on
Apple Silicon Macs.

By vendoring the code, the safety checks still run on all platforms
(Mac, Linux, Windows) without needing unsloth_zoo at all.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-18 09:10:13 -07:00
..
assets studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00
auth fix: remove old comments (#4292) 2026-03-14 16:50:13 +04:00
core Fix studio chat crash on Mac: vendor check_signal_escape_patterns (#4431) 2026-03-18 09:10:13 -07:00
loggers Final cleanup 2026-03-12 18:28:04 +00:00
models Fix tool call parsing, add tool outputs panel and UI improvements (#4416) 2026-03-18 08:28:02 -07:00
plugins Final cleanup 2026-03-12 18:28:04 +00:00
requirements Combine studio setup fixes: frontend caching, venv isolation, Windows CPU support (#4413) 2026-03-18 03:52:25 -07:00
routes Fix tool call parsing, add tool outputs panel and UI improvements (#4416) 2026-03-18 08:28:02 -07:00
state Final cleanup 2026-03-12 18:28:04 +00:00
tests fix(seed): disable remote code execution in seed inspect dataset loads (#4275) 2026-03-13 19:37:43 +04:00
utils Combine studio setup fixes: frontend caching, venv isolation, Windows CPU support (#4413) 2026-03-18 03:52:25 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
colab.py Combine studio setup fixes: frontend caching, venv isolation, Windows CPU support (#4413) 2026-03-18 03:52:25 -07:00
main.py studio: web search, KV cache dtype, training progress, inference fixes 2026-03-17 00:30:01 -07:00
run.py studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00