google-research / google-research/tabfm

Examples not working on PyTorch

Open
#56 2 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

I installed TabFM using PyTorch and tried the two examples given (regression and classification). Both examples failed .

The regression example failed at model = TabFM_HF.from_pretrained(HF_REPO_ID, subfolder=model_type)

'safetensors' is not defined
File "/run/media/juan/DriveName/code/python/TabFM/tabfm/tabfm/src/pytorch/tabfm_v1_0_0.py", line 96, in _from_pretrained
model_id=local_id,
^^^^^^^^^^^^^^^
...<9 lines>...
token=token,

File "/run/media/juan/DriveName/code/python/TabFM/tabfm/tabfm/src/pytorch/tabfm_v1_0_0.py", line 157, in load
model = TabFM_HF.from_pretrained(HF_REPO_ID, subfolder=model_type)
File "/run/media/juan/DriveName/code/python/TabFM/tabfm/examples/regression_example.py", line 29, in run_example
model = tabfm.tabfm_v1_0_0_pytorch.load(model_type="regression")
File "/run/media/juan/DriveName/code/python/TabFM/tabfm/examples/regression_example.py", line 54, in
predictions = run_example()
NameError: name 'safetensors' is not defined

same problem in the regression example.

QUESTION: Should I use JAX instead of Pytorch? The repo has in the results page files whose names suggest that the results were obtained using JAX, not Pytorch .

Contributor guide

Open the contributing guide

Research direction

Start with tabfm/tabfm/src/pytorch/tabfm_v1_0_0.py around line 96, where the NameError occurs, then inspect examples/regression_example.py and the corresponding classification example. Run both examples in the documented PyTorch setup; done means regression and classification complete without the safetensors error, with the JAX-versus-PyTorch expectation clarified.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.