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

[BUG] Load local peft model while base model weight and lora weight are saved in different locations #341

Closed
Opdoop opened this issue May 5, 2023 · 0 comments

Comments

@Opdoop
Copy link
Contributor

Opdoop commented May 5, 2023

https://github.com/lvwerra/trl/blob/c85cdbdbd0d956bbc6f5a8e04b0036648480e7a1/trl/models/modeling_base.py#L205-L220

When the local model weight and the lora weight are saved in different locations, the code will try hf_hub_download and throw HFValidationError: Repo id must be in the form 'repo_name' error. Line 218 will throw this Error again, which leads the process to stop.

@Opdoop Opdoop changed the title [BUG] Load local peft model while base model weight and lora weight save in different location [BUG] Load local peft model while base model weight and lora weight are saved in different location May 5, 2023
@Opdoop Opdoop changed the title [BUG] Load local peft model while base model weight and lora weight are saved in different location [BUG] Load local peft model while base model weight and lora weight are saved in different locations May 5, 2023
Opdoop added a commit to Opdoop/trl that referenced this issue May 5, 2023
younesbelkada pushed a commit that referenced this issue May 11, 2023
* Fix bug when loading local peft model 

Fix bug in #341

* Fix loading bug when load lora mode

Fix loading bug when load lora model but not resuming training

1. Implement the fix logic described in #342 (review)

2. Set peft lora weight to trainable.

* Remove is_trainable

Leave is_trainable to future PR.

* add test_load_pretrained_peft

Check that the model saved with peft class interface can be loaded properly.
@Opdoop Opdoop closed this as completed May 12, 2023
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

1 participant