Repository navigation
Inkling 2 merged save: read and write the config and index as utf-8 - #19135
Merged
Merged
Conversation
test_shipping_code_names_an_encoding is red on main in the CPU rest shard: #19016 opened config.json and model.safetensors.index.json in text mode without an encoding, so on a non-UTF-8 Windows locale a config with a non-ASCII byte fails to load or is written in the locale's codec. Pass encoding = "utf-8" on all four calls.
Member
Author
|
@codex review |
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. Chef's kiss. 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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tests/test_runtime_text_encoding.py::test_shipping_code_names_an_encodingis red onmaininRepo tests (CPU, rest), for example on #19122 and #19127:Cause
The guard is right; the new code is wrong.
#19016 (Inkling 2 merged 16-bit save and GGUF export) added four text-mode
open()calls with no encoding:model.safetensors.index.json(index_path);config.json;config.json.On Windows, Python uses the locale code page there. A config or index with a non-ASCII byte then fails to load, or is written in a codec the next reader does not expect. The guard has been in the repo since October; the lines all come from
c69ffd79be.Fix
Pass
encoding = "utf-8"on all four calls inunsloth/models/inkling2.py. Nothing else changes: the JSON written is the same on a UTF-8 host.Verification
tests/test_runtime_text_encoding.py: 9 passed (main: 1 failed, listing exactly these four sites).tests/test_inkling2_support.pyon transformers 5.24.0, including the merged-save tests: 42 passed.