Pull requests / #570

#570 setup: a read-only --gguf-dir no longer stops setup when marking checked shards

closed · @gputier · 0 comentarios · En GitHub

Setup & installAMD / HIPModels & quantsLinux

Descripción

With `--gguf-dir` pointing at a folder setup cannot write to (a share, a read-only mount), shards that are whole but have no `.done` mark reach `mark()` in the loop at setup.py:3319-3321. `mark()` writes `<shard>.done`, the write raises an OSError, and setup stops with a traceback, although the files are fine and `have_model` already accepts a `--gguf-dir` shard without a mark (`done(s) or a.gguf_dir`).

The mark is now written inside a try, and an OSError becomes a warning: `<shard> is whole but its finish mark cannot be written (<error>)`. Setup goes on.

Test: `ReadOnlyGgufDir` in tools/test_setup_choices.py runs setup.main() through the existing `install()` helper with two empty shard files in a `--gguf-dir`, `whole_shard` forced to True and `mark` raising PermissionError for paths under that folder. On v0.1.37 the PermissionError comes out of setup. With the change, setup exits 0 and prints the warning. The read-only folder is simulated with the mock, not a real read-only mount.

Python suite in a python:3.12-slim container: 416 passed, 47 failed, the same 47 as on a clean v0.1.37 (on Linux `setup.EXE` is "strata", which breaks tools/test_setup_golden.py's `normalize()` and `test_prebuilt_hip_zip`). With `EXE` forced to "strata.exe": 417 passed, none failed.

En el sitio

Enlaces a install, modelos, releases.