Skip to content

Comments

directly pass the model path through + simplify the v2 vs v2.5 logic#177

Open
LeoGrin wants to merge 3 commits intomainfrom
lg-pass-model-path-directly
Open

directly pass the model path through + simplify the v2 vs v2.5 logic#177
LeoGrin wants to merge 3 commits intomainfrom
lg-pass-model-path-directly

Conversation

@LeoGrin
Copy link
Contributor

@LeoGrin LeoGrin commented Nov 7, 2025

Change Description

Try to be precise. You can additionally add comments to your PR, this might help the reviewer a lot.

Pass the model path directly instead of having a different format than the TabPFN package, which simplify the logic. Tried quick_test.py which is working except for the default checkpoint which is not on the server yet (https://github.com/PriorLabs/tabpfn-server/pull/432).

If you used new dependencies: Did you add them to requirements.txt?

Who did you ping on Mattermost to review your PR? Please ping that person again whenever you are ready for another review.

Breaking changes

If you made any breaking changes, please update the version number.
Breaking changes are totally fine, we just need to make sure to keep the users informed and the server in sync.

Does this PR break the API? If so, what is the corresponding server commit?

Does this PR break the user interface? If so, why?


Please do not mark comments/conversations as resolved unless you are the assigned reviewer. This helps maintain clarity during the review process.


Note

Directly pass model_path through and replace name-to-path selection with simple version defaults for v2/v2.5 across classifier and regressor, updating tests accordingly.

  • Estimator (tabpfn_client/estimator.py):
    • Remove model selection layer (TabPFNModelSelection), name-to-path mapping, and related constants.
    • Add helpers _default_model_path_v2() and _default_model_path_v2_5(); use explicit v2 ckpt paths and None for v2.5 auto-selection.
    • Update TabPFNClassifier and TabPFNRegressor:
      • Constructors accept model_path: Optional[str] = None.
      • Add/reshape create_default_for_version() to set model_path via helpers.
      • fit/predict pass self.model_path directly in config.
  • Tests:
    • Remove tests for listing/validating model names and _model_name_to_path.
    • Add tests asserting model_path is forwarded to server config and create_default_for_version() sets v2 defaults, None for v2.5, applies overrides, and errors on invalid version.

Written by Cursor Bugbot for commit fb80d35. This will update automatically on new commits. Configure here.

@LeoGrin LeoGrin requested a review from a team as a code owner November 7, 2025 14:09
@LeoGrin LeoGrin requested review from noahho and removed request for a team November 7, 2025 14:09
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @LeoGrin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the model path handling and selection logic within the tabpfn_client module. It simplifies the internal architecture by removing a dedicated base class for model selection, allowing for more direct specification of model paths and centralizing default path determination into helper functions. This change aims to improve clarity and maintainability of the model instantiation process.

Highlights

  • Refactored Model Selection: The TabPFNModelSelection base class has been removed, streamlining the model selection process for both classifiers and regressors.
  • Simplified Model Path Handling: The model_path parameter in TabPFNClassifier and TabPFNRegressor now directly accepts the full model path or the string "auto" for default selection, eliminating intermediate name-to-path conversion logic.
  • Dedicated Default Path Functions: New private helper functions, _default_model_path_v2 and _default_model_path_v2_5, were introduced to encapsulate the logic for determining default model paths for different versions (v2 and v2.5).
  • Relocated create_default_for_version: The create_default_for_version class method has been moved from the removed base class directly into TabPFNClassifier and TabPFNRegressor for better encapsulation and clarity.
  • Removed Redundant Tests: Unit tests specifically related to the TabPFNModelSelection class were removed from test_tabpfn_classifier.py and test_tabpfn_regressor.py as the class no longer exists.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 does a great job of simplifying the model selection logic by removing the TabPFNModelSelection class and passing the model_path directly. The new default of "auto" is a sensible change that improves robustness. The associated test removals are also appropriate.

I have a few suggestions to further improve the code:

  • I've pointed out some code duplication in create_default_for_version between the classifier and regressor that could be refactored into a base class to improve maintainability.
  • I've also suggested re-adding simplified tests to verify that a custom model_path is correctly passed to the inference client, as removing the old tests has created a small gap in test coverage for this functionality.

Overall, these are solid changes that make the client easier to understand and use.

@LeoGrin LeoGrin requested review from brendan-priorlabs and removed request for noahho November 7, 2025 14:39
Copy link
Collaborator

@brendan-priorlabs brendan-priorlabs left a comment

Choose a reason for hiding this comment

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

Unfortunately this looks like a breaking change. I don't think we can go ahead with it easily. Note that tabpfn-time-series and tabpfn-extensions both have dependencies on our existing setup as do users. Let's discuss more in person?

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.

2 participants