google-research / google-research/tabfm

Pin the Hugging Face revision when loading pretrained weights

Open
#88 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.6k
Forks
270
Avg merge
1d 7h
Merged PRs (30d)
1

Description

Both `load()` paths fetch the pretrained weights from Hugging Face without asking for a particular revision, so each call resolves to whatever `main` points at at that moment:

- PyTorch — `tabfm/src/pytorch/tabfm_v1_0_0.py:157`
- JAX — `tabfm/src/jax/tabfm_v1_0_0.py:279-280`

`revision` is already threaded through `_from_pretrained` in both files, so the plumbing exists — it is simply never given a value, and there is no checksum either.

`main` on `google/tabfm-1.0.0-pytorch` has moved ten times, and one of those commits changed the weight format outright:

```
702835545c8c 2026-07-02 convert weights to safetensors (#3)
```

That is the same change behind callers looking for `pytorch_model.bin` and not finding it, which is what #53 and #77 are about. Anyone who had pinned a revision would have kept working across that day and could then have moved deliberately.

Two things a pin would buy you:

- **Reproducibility** — a given tabfm version resolves to the same weights every time, so a result from three months ago can be reached again.
- **Integrity** — users are not moved onto different weights without noticing.

I have not sent a patch, because deciding *which* commit is the blessed one is your call and I would only be guessing. If it helps, the current head is `77cb9cc1b4fd`, and the shape would be a module-level constant passed as `revision=` in both loaders, still overridable by the caller.

Glad to send the PR once you say which revision it should be.

Disclosure: I used an AI assistant while looking into this. I checked the file references and the Hugging Face commit list myself.

Contributor guide

Open the contributing guide

Research direction

Read the PyTorch loader at tabfm/src/pytorch/tabfm_v1_0_0.py:157 and the JAX loader at tabfm/src/jax/tabfm_v1_0_0.py:279-280, then trace _from_pretrained in both files. Review the Hugging Face commit history and confirm the maintainer-selected blessed revision. Done means both load paths use that revision while still allowing caller overrides.

Written by the indexing model from the issue text.

Assessment

Tech stack
huggingface, python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.