Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jeffkinnison
Copy link
Contributor

When using an adapter, the LLMEncoder uses custom state_dict() ans load_state_dict() logic to only save/load adapter parameters, however loading would fail when using strict mode due to

  • The base model's parameters being excluded from state_dict (missing_keys)
  • The adapter parameters being recorded under different names under the hood by peft (unexpected_keys)

None of these keys are missing or unexpected under the custom logic, though, so the lists of missing and unexpected keys must be updated to reflect our expected state. This PR adds a post-load hook that updates the missing_keys and unexpected_keys lists to reflect our custom logic, and it re-enables a unit test that checks loading adapter state.

@github-actions
Copy link

github-actions bot commented Dec 19, 2023

Unit Test Results

  6 files  ±0    6 suites  ±0   13m 56s ⏱️ +5s
12 tests ±0    9 ✔️ ±0    3 💤 ±0  0 ±0 
60 runs  ±0  42 ✔️ ±0  18 💤 ±0  0 ±0 

Results for commit f800b6b. ± Comparison against base commit aa17e08.

♻️ This comment has been updated with latest results.

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