mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
PyTorch 1.9 lazy loader compatibility bugfix
This commit is contained in:
@ -195,7 +195,7 @@ def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, miss
|
|||||||
missing_keys.append(key)
|
missing_keys.append(key)
|
||||||
|
|
||||||
extra_state_key = prefix + _EXTRA_STATE_KEY_SUFFIX
|
extra_state_key = prefix + _EXTRA_STATE_KEY_SUFFIX
|
||||||
if getattr(self.__class__, "set_extra_state", Module.set_extra_state) is not Module.set_extra_state:
|
if hasattr(Module, "set_extra_state") and getattr(self.__class__, "set_extra_state", Module.set_extra_state) is not Module.set_extra_state: # if getattr(self.__class__, "set_extra_state", Module.set_extra_state) is not Module.set_extra_state:
|
||||||
if extra_state_key in state_dict:
|
if extra_state_key in state_dict:
|
||||||
self.set_extra_state(state_dict[extra_state_key])
|
self.set_extra_state(state_dict[extra_state_key])
|
||||||
elif strict:
|
elif strict:
|
||||||
|
Reference in New Issue
Block a user