Clean load keys (#24505)

* Preliminary work on some models

* Fix test load missing and make sure nonpersistent buffers are tested

* Always ignore nonpersistent buffers if in state_dict

* Treat models

* More models

* Treat remaining models

* Fix quality

* Fix tests

* Remove draft

* This test is not needed anymore

* Fix copies

* Fix last test

* Newly added models

* Fix last tests

* Address review comments
This commit is contained in:
Sylvain Gugger
2023-06-27 14:45:40 -04:00
committed by GitHub
parent 53194991e9
commit 8e5d1619b3
138 changed files with 320 additions and 1140 deletions

View File

@@ -1190,7 +1190,6 @@ SAM_INPUTS_DOCSTRING = r"""
SAM_START_DOCSTRING,
)
class SamModel(SamPreTrainedModel):
_keys_to_ignore_on_load_missing = [r"prompt_encoder.shared_embedding.positional_embedding"]
_tied_weights_keys = ["prompt_encoder.shared_embedding.positional_embedding"]
def __init__(self, config):