Skip to content

Commit

Permalink
update follow comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lugimzzz committed Dec 16, 2024
1 parent 59b8318 commit de95c5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions paddlenlp/mergekit/merge_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MergeConfig:
weight_list: Optional[List[float]] = field(
default=None, metadata={"help": "Relative (or absolute if normalize=False) weighting of a given tensor"}
)
normalize: bool = field(default=False, metadata={"help": "Whether to normalize the weighting."})
normalize: bool = field(default=True, metadata={"help": "Whether to normalize the weighting."})
slerp_alpha: float = field(default=0.5, metadata={"help": "Slerp alpha."})
slerp_normalize_eps: float = field(default=1e-8, metadata={"help": "Slerp normalization epsilon value"})
slerp_dot_threshold: float = field(
Expand Down Expand Up @@ -142,7 +142,7 @@ def from_pretrained(cls, pretrained_model_path, **kwargs):
if os.path.isfile(os.path.join(pretrained_model_path, MERGE_CONFIG_NAME)):
config_file = os.path.join(pretrained_model_path, MERGE_CONFIG_NAME)
else:
raise ValueError(f"Can't find lora_config.json at '{pretrained_model_path}'")
raise ValueError(f"Can't find merge_config.json at '{pretrained_model_path}'")

loaded_attributes = cls.from_json_file(config_file)

Expand Down
4 changes: 3 additions & 1 deletion paddlenlp/mergekit/merge_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ def check_model_path(self, model_path):
elif os.path.exists(os.path.join(model_path, self.weight_name())):
file_type = "pdparams"
else:
raise ValueError(f"Please check path {model_path} is correct.")
raise ValueError(
f"Please check path {model_path} is correct. Support safetensors and pdparams in complete parameter format (not TP or PP format) only."
)
return file_type

def weight_name(self):
Expand Down

0 comments on commit de95c5b

Please sign in to comment.