Add TabFM and fix foundation-model integration bugs#111
Open
andreasgoethals wants to merge 2 commits into
Open
Add TabFM and fix foundation-model integration bugs#111andreasgoethals wants to merge 2 commits into
andreasgoethals wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new optional TabFM method integration to TALENT’s unified method registry/config system, while also fixing several integration and preprocessing edge cases that affect foundation-model wrappers and the Python API.
Changes:
- Added a
tabfmmethod wrapper (optional dependency) and registered it with matching default + opt-space configs. - Fixed preprocessing edge cases (unknown categorical replacement and constant regression-target normalization).
- Fixed Python API
TALENT.run(..., args=...)override/default handling and improved device handling in TabPTM temporary tensors.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| TALENT/model/methods/tabptm.py | Makes temporary tensors device-aware (no hardcoded .cuda()), plus trailing whitespace cleanup. |
| TALENT/model/methods/tabfm.py | Adds a new TabFM wrapper (optional tabfm[pytorch]) for zero-shot classification/regression. |
| TALENT/model/method_registry.py | Registers tabfm in the unified method registry with constraints and notes. |
| TALENT/model/lib/data.py | Fixes unknown-categorical replacement logic and guards against divide-by-zero in regression label normalization. |
| TALENT/configs/opt_space/tabptm.json | Fixes incorrect top-level key (tabpfn → tabptm). |
| TALENT/configs/opt_space/tabfm.json | Adds TabFM opt-space config stub + general defaults. |
| TALENT/configs/default/tabfm.json | Adds TabFM default config stub + general defaults. |
| TALENT/api.py | Updates run() kwarg/args precedence logic for seeds and tuning fields. |
| readme.md | Documents TabFM as an optional method and updates the foundation-model cap note + acknowledgements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+457
to
+461
| args.seed = getattr(args, "seed", 0) | ||
| args.seed_num = getattr(args, "seed_num", 1) | ||
| args.tune = getattr(args, "tune", False) | ||
| args.n_trials = getattr(args, "n_trials", 50) | ||
| args.tune_metric = getattr(args, "tune_metric", None) |
Comment on lines
+231
to
+234
| else: | ||
| vl = self.criterion( | ||
| torch.tensor(test_logit), torch.tensor(test_label) | ||
| ).item() |
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.
Add TabFM and fix foundation-model integration bugs
Summary
tabfm, an optional Google Research TabFM v1.0.0 method wrapper using the upstreamtabfm[pytorch]package.tabfmin the unified method registry and add matching default / opt-space configs.TALENT/configs/opt_space/tabptm.json, whose top-level key incorrectly pointed totabpfn.TALENT.run(..., args=...)respects suppliedseed,seed_num,tune,n_trials, andtune_metricfields unless explicitly overridden.Notes
tabfmis optional and not added as a hard dependency. Users should install it with:pip install -U "tabfm[pytorch]"TabFM v1.0.0 classification is limited to 10 classes by the upstream model. The wrapper raises a clear
ValueErrorbefore loading the model if a dataset exceeds that limit.The wrapper uses the PyTorch backend because TALENT already centers on PyTorch and the upstream TabFM package exposes
tabfm_v1_0_0_pytorch.The upstream TabFM source code is Apache 2.0, while the published model weights are under the TabFM Non-Commercial License.
Validation
python -m compileall -q TALENT testgit diff --checkargs.tune=Trueis now honored byTALENT.run(..., args=...).Follow-Up
tabfmrequire installingtabfm[pytorch]and downloading the upstream Hugging Face weights.