mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
[from_pretrained
] Fix failing PEFT tests (#25733)
fix failing PEFT tests
This commit is contained in:
parent
1b2381c46b
commit
fd0b94fd7b
@ -2406,8 +2406,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
|
||||
_commit_hash=commit_hash,
|
||||
)
|
||||
if _adapter_model_path is not None and os.path.isfile(_adapter_model_path):
|
||||
with open(_adapter_model_path, "r", encoding="utf-8"):
|
||||
with open(_adapter_model_path, "r", encoding="utf-8") as f:
|
||||
_adapter_model_path = pretrained_model_name_or_path
|
||||
pretrained_model_name_or_path = json.load(f)["base_model_name_or_path"]
|
||||
|
||||
# change device_map into a map if we passed an int, a str or a torch.device
|
||||
if isinstance(device_map, torch.device):
|
||||
|
Loading…
Reference in New Issue
Block a user