Skip to content

Fix missing pretrained weight fallback#179

Merged
jbohnslav merged 1 commit into
masterfrom
codex/test-pr-125
Jul 3, 2026
Merged

Fix missing pretrained weight fallback#179
jbohnslav merged 1 commit into
masterfrom
codex/test-pr-125

Conversation

@jbohnslav

Copy link
Copy Markdown
Owner

Summary

Reimplements the behavior proposed in #125 against the current codebase.

When L2-SP regularization is configured but the pretrained weights directory does not contain weights for the selected model architecture, get_regularization_loss() currently raises KeyError before reaching its existing fallback path. This changes the lookup to treat a missing model/architecture as no pretrained file found, so the existing L2 fallback is used.

Credit to @antortjim for the original report and fix idea in #125.

Testing

  • uv run pytest -q tests/test_losses.py
  • uv run pytest -q -> 29 passed, 5 deselected

Supersedes #125.

@jbohnslav

Copy link
Copy Markdown
Owner Author

@codex review

@claude

claude Bot commented Jul 3, 2026

Copy link
Copy Markdown

Claude finished @jbohnslav's task in 1s —— View job


I'll analyze this and get back to you.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 8f982ffc8f

ℹ️ 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".

@jbohnslav jbohnslav merged commit 1541eec into master Jul 3, 2026
6 checks passed
@jbohnslav jbohnslav deleted the codex/test-pr-125 branch July 3, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant