Commit ca47d07
fix: lazy-import heavy dependencies in CLI to fix commands without backend extras (#571)
`art install-skills`, `art train-sft`, `art train-rl`, and `art migrate`
all crash with ModuleNotFoundError when backend extras (torch, fastapi,
uvicorn, numpy) are not installed, even though they don't need them.
- Move fastapi, uvicorn, pydantic, LocalBackend, and other backend-only
imports from top-level cli.py into the `run` command where they're
actually used
- Remove unused imports (Optional, Provider, TogetherDeploymentConfig,
WandbDeploymentConfig)
- Lazy-import calculate_step_std_dev in model.py to break the
__init__ -> utils -> model -> numpy eager import chain
Co-authored-by: Claude Opus 4.6 <[email protected]>1 parent 8714773 commit ca47d07
2 files changed
Lines changed: 17 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 7 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 8 | | |
25 | 9 | | |
26 | 10 | | |
| |||
302 | 286 | | |
303 | 287 | | |
304 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
305 | 301 | | |
306 | 302 | | |
307 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
638 | 637 | | |
639 | 638 | | |
640 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
641 | 644 | | |
642 | 645 | | |
643 | 646 | | |
| |||
0 commit comments