Repository navigation
Lora: fail GGUF export when no .gguf is produced - #17627
Conversation
|
That test's |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Read the NPU compat fixtures as UTF-8 `tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding` fails on `main` since #18050. It shows up on unrelated PRs as `Repo tests (CPU, rest-2)`, for example #18104 and #17627: ``` E AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding ... E Left contains one more item: 'studio/backend/tests/test_npu_compat.py:18: read_text()' ``` ### Cause #18050 added two reads of the checked-in fixture `fixtures/npu_compat/hf_configs.json` that call `.read_text()` with no encoding: - `studio/backend/tests/test_npu_compat.py:18` - `studio/backend/tests/test_export_npu_q4nx.py:677` Without an encoding, Python decodes with the platform default, which is the ANSI codepage on Windows. The lint fails that as soon as a fixture gains a non-ASCII byte. ### Fix Both reads now pass `encoding = "utf-8"`. The fixture is JSON, so it is UTF-8 by definition. Nothing else changes. The other bare `.read_text()` in `test_npu_compat.py`, at line 88, reads a file the test itself wrote into `tmp_path`. The lint deliberately leaves those alone, so it is unchanged. ### Verification - `tests/test_source_read_encoding.py`: fails on `main` on both lines and passes with this change (16 passed). - `tests/test_npu_compat.py` and `tests/test_export_npu_q4nx.py`: 96 passed. - ruff is clean.
LoRA GGUF export could write only adapter safetensors, log
(none), and still report success. Withpush_to_hub=True, it would upload a folder with no GGUF. A leftover.ggufcould also make a no-op conversion look successful.The model-GGUF path already rejects missing output and calls out this failure in its #7897 comment. This adds the missing check to LoRA exports, including the second save used for Hub staging. Both converter wrappers also check that their output file exists.
For reused folders,
_ReusedFolderWritesseparates new files from leftovers. If it can't tell, a clean staged save has to produce a GGUF first. That save is reused for upload so there's no extra conversion.Tests
The six failure cases reproduced the bug before the fix.
safetensorsmissing).git diff --checkpass.No real GGUF conversion or Hub upload was run.