unsloth/studio/backend/core/inference
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
..
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
audio_codecs.py studio: per-model inference defaults, GGUF slider fix, reasoning toggle (#4325) 2026-03-16 06:37:55 -07:00
defaults.py studio: web search, KV cache dtype, training progress, inference fixes 2026-03-17 00:30:01 -07:00
inference.py studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00
llama_cpp.py Fix tool call parsing, add tool outputs panel and UI improvements (#4416) 2026-03-18 08:28:02 -07:00
orchestrator.py feat(studio): infinite scroll for recommended models list (#4414) 2026-03-18 03:17:01 -07:00
tools.py Fix studio chat crash on Mac: vendor check_signal_escape_patterns (#4431) 2026-03-18 09:10:13 -07:00
worker.py Combine studio setup fixes: frontend caching, venv isolation, Windows CPU support (#4413) 2026-03-18 03:52:25 -07:00