Skip to content

Display peft error - #2334

Closed
Iemand005 wants to merge 2 commits into
unslothai:mainfrom
Iemand005:main
Closed

Iemand005 wants to merge 2 commits into
unslothai:mainfrom
Iemand005:main

Conversation

@Iemand005

Copy link
Copy Markdown

My script was starting and stopping without displaying any errors or showing any signs something was wrong, it just refused to run.
I did some debugging and found that a 404 is thrown when trying to fetch adapter_config.json. This error is caught but after that, nothing is done with the error. Maybe in some cases it's supposed to continue working despite a peft error but in this my case it's supposed to throw the peft error or at least display it in the console:

peft_error = str(error)

I added a print so that if any error occurs fetching the config it at least lets the user know so they know what's going on.

Comment thread unsloth/models/loader.py
except Exception as error:
peft_error = str(error)
is_peft = False
print("Unsloth: Failed to get peft config: {peft_error}.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we should notify to the user only if both the peft and auto_config fail
Otherwise, it'd confuse people why unsloth would be warning for missing peft when they are trying to load base model

@rolandtannous

rolandtannous commented Aug 15, 2025 •

Copy link
Copy Markdown
Contributor

The original issues in this PR seems to already been addressed in the latest codebase.
Current code base raises a combined error when the model neither is a base model or a peft model, inline with Datta's comment [here]:(

elif not is_model and not is_peft:
)
and here:
elif not is_model and not is_peft:

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

Successfully merging this pull request may close these issues.

3 participants