Bug: encoder.pt and config not loaded correct during resume
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 1.5k
- Forks
- 125
- Avg merge
- 22d 8m
- Merged PRs (30d)
- 1
Description
There seems to be a mismatch in how the model is loaded during resume.
See the original code:
https://github.com/microsoft/KBLaM/blob/029e2fb8585117ae59ae332c88dc7732b53727d4/experiments/train.py#L906-L908
This needs to be changed to
if model_dir_to_resume:
encoder.load_state_dict(torch.load(os.path.join(model_dir_to_resume, "_encoder/encoder.pt")))
kb_config = KBLaMConfig.from_pretrained(os.path.join(model_dir_to_resume, "config.json"))
# or kb_config = KBLaMConfig.from_pretrained(model_dir_to_resume)
Why this change is neede:
• encoder.pt is saved inside an other folder _encoder/
• the config is saved as config.json, not kb_config.json
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at experiments/train.py around lines 906-908 and inspect the resume-loading path. Verify that it reads encoder.pt from the _encoder directory and loads config.json, then confirm that resuming a saved model succeeds with both the encoder and configuration restored.
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
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100