Repository navigation
Studio: let Laya fine-tunes answer from their GGUF export - #16511
Conversation
|
@codex review |
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 633ce206e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| try: | ||
| tokenizer, mask = _export_tokenizer(checkpoint) | ||
| except Exception as exc: | ||
| _unloadable.add((_binary_key(resolve_binary()), checkpoint)) |
There was a problem hiding this comment.
Avoid permanently caching tokenizer read failures
If a tokenizer file is temporarily missing or unreadable, this turns a recoverable read failure into a process-lifetime refusal. Repairing tokenizer.json or tokenizer_config.json does not change the cached checkpoint key, whose revision covers only the GGUF files, and unload() does not clear _unloadable. I verified that tokenizer validation succeeds after repair, but subsequent select() calls still return 503 even after unloading. Keep these read failures retryable, or invalidate the refusal when the tokenizer changes, so recovery does not require restarting Studio or re-exporting the GGUF.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: the tokenizer folder comes from the training run and is required for the folder to be listed, so a missing or broken one is a broken fine-tune that PyTorch cannot load either. Hand-repairing it in place without a re-export is not a path we support, and Auto still falls back to PyTorch.
|
I cancelled the CI runs on this PR for now, since Codex hasn't converged at the current head yet: the latest push hasn't been reviewed by Codex yet. CI here runs on the team's shared runner pool, and it's backed up right now (380+ runs queued), so runs on code that's still changing push everyone else's back. Once Codex says "Didn't find any major issues" on the head commit, one push or a re-run brings CI back. A small ask going forward: hold the push until Codex is clean, and batch follow-up fixes into a single push. Thanks! |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b988fde743
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| tokenizer.encode(text.replace(mask, " "), add_special_tokens = False).ids | ||
| ) | ||
| config = Path(checkpoint.source).expanduser() / "rl_agent_config.json" | ||
| head_max_len = int(json.loads(config.read_text(encoding = "utf-8")).get("head_max_len", 192)) |
There was a problem hiding this comment.
Bound question validation by the exported head-token limit
For local Laya checkpoints whose raw head_max_len is reduced during export, this guard accepts questions that llama.cpp will silently truncate. unsloth/models/decision_gguf.py::_laya_max_head_tokens() writes _served_lengths()'s normalized limit to the GGUF: an encoder window of 384 with max_len=384, head_max_len=256, for example, exports a 192-token head. An instruction of about 200 tokens with short noul options passes this 256-token check and fits the 384-token context, yet exceeds the server's actual question budget, so it gets answered with part of the instruction missing instead of returning 422. Bound validation by the exported limit as well as the source configuration.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not reachable for Laya: every Laya encoder (ModernBERT-large, mmBERT) has 8192 positions, so the exported head limit is max(head_max_len, 256) and never below the raw head_max_len this checks. The check can only be stricter than llama.cpp, which matches what the PyTorch path refuses.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f26e03afae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| from .gguf_export_contract import served_files | ||
|
|
||
| files = served_files(Path(checkpoint.source).expanduser(), "clef") | ||
| files = served_files(Path(checkpoint.source).expanduser(), checkpoint.layout) |
There was a problem hiding this comment.
Resolve Laya exports under the selected subfolder
For a local Laya configured with UNSLOTH_SYSTEMONE_SUBFOLDER, catalog.default_checkpoint() preserves the subfolder and the PyTorch loader uses it, but this lookup and _native_files() search only checkpoint.source. If the root has its own current GGUF export, choosing llama.cpp silently serves that different model under the configured checkpoint's name; a subfolder-only export is ignored entirely. Resolve the effective checkpoint directory (source / subfolder) consistently for the export, configuration, and tokenizer reads.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 5e8edb9: the export, rl_agent_config.json and tokenizer are now read from source/subfolder, with a test that a root export is not served for a subfolder checkpoint.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
|
Cross-platform CI on That job installs the backend test requirements without |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
|
pre-commit.ci run |
A Laya fine-tune could be exported to GGUF from the Export page, which says the file is for llama.cpp's decision server, but the Decision API never used it. The fine-tune kept answering on PyTorch, even with the runtime set to llama.cpp, so the export did nothing.
A Laya fine-tune with a current export now answers through llama.cpp when the runtime is set to llama.cpp, and the Decision settings show the Runtime row for it. Auto stays on PyTorch, so existing fine-tunes keep the same answers unless llama.cpp is chosen. On llama.cpp, a state past the model's window is refused, and so is a question over the option or instruction budget, which llama.cpp would otherwise cut without saying so. Long options are answered as on PyTorch.
Exports of multilingual fine-tunes remain a dead end. llama.cpp refuses the mmBERT tokenizer, so choosing llama.cpp for one returns a 503 with the reason, and the Export page still offers them.
confidencealso differs by runtime: the same fine-tune and question gave 0.97 on llama.cpp and 0.87 on PyTorch. The stock Laya models stay on PyTorch, Laya GGUF is unchanged, and a fine-tune with no export or a stale one works as before.Merge after #16496, which asks blank Laya questions by their id the way llama.cpp already does.
Before / after
Settings > API > Decision, with a Laya fine-tune that has a current GGUF export and the runtime set to llama.cpp. Before, there is no Runtime row and the fine-tune answers on PyTorch. After, the Runtime row shows llama.cpp, and the settings API reports
effective_backend: llama.cpp,has_gguf_form: true.