Closed fablos closed 2 months ago
Quick fix, by simply adding dict_key_x="input_ids"
while we create the Laplace instance in the file lora.py
seems to fix the issue.
if cfg.subset_of_weights == "last_layer":
self.bnn = Laplace(
model,
likelihood="regression",
subset_of_weights=cfg.subset_of_weights,
hessian_structure=cfg.hess_factorization,
sigma_noise=1 if cfg.noise_var is None else math.sqrt(cfg.noise_var),
last_layer_name=cfg.last_layer_name,
dict_key_x="input_ids",
)
else:
self.bnn = Laplace(
model,
likelihood="regression",
subset_of_weights=cfg.subset_of_weights,
hessian_structure=cfg.hess_factorization,
sigma_noise=1 if cfg.noise_var is None else math.sqrt(cfg.noise_var),
dict_key_x="input_ids",
)
Yup, thanks a lot for testing this! The code for the paper uses a pre-released version of laplace-torch
. Since then laplace-torch
has been updated to v0.2 and so there are some breaks here and there.
Fixed by #3 and also upstream in laplace-torch
. Thanks @fablos!
python run_finetuning.py --foundation_model t5-base --problem redox-mer
completes the training but soon after Fitting Laplace raises the following error stack:Conda Enviroment on Ubuntu 24.04 created following instruction in Setup from the file README.md and fix
pip install git+https://github.com/aleximmer/laplace@update-deps
.