Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'LlamaModel' object has no attribute 'model' #1537

Open
sert121 opened this issue Jan 14, 2025 · 7 comments
Open

AttributeError: 'LlamaModel' object has no attribute 'model' #1537

sert121 opened this issue Jan 14, 2025 · 7 comments

Comments

@sert121
Copy link

sert121 commented Jan 14, 2025

Facing the following error as soon as I start training the model using unsloth, tried a different environment, also reinstalling unsloth in a fresh env, nothing works, could you please help out?

0%| | 0/8820 [00:00<?, ?it/s]Traceback (most recent call last):
line 98, in train
trainer_stats = trainer.train()
File "", line 157, in train
File "", line 331, in _fast_inner_training_loop
File "/network/scratch/y/yash.more/rehaul_textmin/v1/lib/python3.10/site-packages/unsloth/models/_utils.py", line 1010, in _unsloth_get_batch_samples
f = model.base_model.model.forward if hasattr(model, "base_model") else model.forward
File "/network/scratch/y/yash.more/rehaul_textmin/v1/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1931, in getattr
raise AttributeError(
AttributeError: 'LlamaModel' object has no attribute 'model'

@danielhanchen
Copy link
Contributor

Did you run model = FastLanguageModel.get_peft_model

@sert121
Copy link
Author

sert121 commented Jan 14, 2025

I didnt, but i dont wanna use peft,I wanted to do full finetuning which was working fine before with unsloth

@sert121
Copy link
Author

sert121 commented Jan 14, 2025

Could you give suggestions to fix/debug it further? i only removed the peft part, but the training script is the same as suggested by unsloth

@danielhanchen
Copy link
Contributor

danielhanchen commented Jan 16, 2025

@sert121 Apologies currently does not yet support full finetuning. We plan to add support soon! Sorry!

@sert121
Copy link
Author

sert121 commented Jan 16, 2025

@danielhanchen I actually had finetuned (fully) using unsloth few weeks ago! I just had to remove the prft config and use the fastmodel in sft. But that somehow stopped working recently, could you shed some light on it?

@danielhanchen
Copy link
Contributor

@sert121 Oh it's not supposed to work :( I added better error handling - if you want, you could try downgrading Unsloth to an earlier version maybe?

@sert121
Copy link
Author

sert121 commented Jan 21, 2025

How do i do that? it downloads automatically the newer oackages whenever it loads unsloth, any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants