Skip to content

Commit eced2ed

Browse files
FIX Don't assume model_config contains model_type (#1012)
1 parent e98df91 commit eced2ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/peft/peft_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ def create_or_update_model_card(self, output_dir: str):
673673
model_config = self.config
674674
if hasattr(model_config, "to_dict"):
675675
model_config = model_config.to_dict()
676-
if model_config["model_type"] != "custom":
676+
if model_config.get("model_type", "custom") != "custom":
677677
card.data["base_model"] = model_config["_name_or_path"]
678678

679679
lines = card.text.splitlines()

0 commit comments

Comments
 (0)