Skip to content

Conversation

@oscarkey
Copy link
Contributor

  • If the config is not present, guess the model version and load an appropriate default instead. This will be updated to include the v2.5 default.
  • Use Pydantic to parse the InferenceConfig. There is a slight risk that parsing might fail at runtime for something it didn't before, but I couldn't see any problems in our repositories.
  • I added some unit tests for the loading code, but overall this is covered by test_..._interface.py, which tries out all the different checkpoints.

@oscarkey
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the handling of InferenceConfig to load it from model checkpoints, with a fallback to default configurations. It also migrates InferenceConfig to use Pydantic for parsing, which simplifies the code. The changes are well-structured and include relevant tests for the new loading logic. My feedback focuses on a couple of instances of code duplication that could be refactored to improve maintainability.

- If the config is not present, guess the model version and load an
  appropriate default instead. This will be updated to include the v2.5
  default.
- Use Pydantic to parse the InferenceConfig. There is a slight risk that
  parsing might fail at runtime for something it didn't before, but I
  couldn't see any problems in our repositories.
@oscarkey oscarkey force-pushed the ok-checkpoint-config branch from 2675f1d to 696239c Compare October 29, 2025 18:15
@oscarkey oscarkey requested a review from bejaeger October 29, 2025 18:38
@oscarkey oscarkey marked this pull request as ready for review October 29, 2025 18:38
@oscarkey oscarkey requested a review from a team as a code owner October 29, 2025 18:38
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Contributor

@bejaeger bejaeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! thanks for adding this.
I have mostly minior comments except one, which is about what object we want to version. Shouldn't it be the entire InferenceConfig?

Copy link
Contributor

@bejaeger bejaeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! Made one more suggestion that you may or may not want to include in here, and then flagged the test prediction difference as a potential sign of a bug?

@oscarkey oscarkey merged commit a77394e into main Oct 30, 2025
10 checks passed
@oscarkey oscarkey deleted the ok-checkpoint-config branch October 30, 2025 12:27
oscarkey added a commit that referenced this pull request Nov 12, 2025
…present. (#220)

* Record copied public PR 576

* Load the inference config from the checkpoint, if present. (#576)

- If the config is not present, guess the model version and load an appropriate default instead. This will be updated to include the v2.5 default.
- Use Pydantic to parse the InferenceConfig. There is a slight risk that parsing might fail at runtime for something it didn't before, but I couldn't see any problems in our repositories.
- I added some unit tests for the loading code and config, but overall this is covered by `test_..._interface.py`, which tries out all the different checkpoints.

Co-authored-by: Benjamin Jaeger <benjamin@priorlabs.ai>

* Fix tests.

* Fix v2.5 and default preprocessing.

* Fix tests.

---------

Co-authored-by: mirror-bot <mirror-bot@users.noreply.github.com>
Co-authored-by: Oscar Key <oscar@priorlabs.ai>
Co-authored-by: Benjamin Jaeger <benjamin@priorlabs.ai>
oscarkey added a commit that referenced this pull request Nov 12, 2025
I copied and pasted it wrong before in
#576
oscarkey added a commit that referenced this pull request Nov 12, 2025
I copied and pasted it wrong before in
#576
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.

3 participants