Skip to content

Commit cd5ca82

Browse files
authored
Update export model (#8671)
* Update sequence_parallel for predict * Do not save moe_group * update export model
1 parent 513e21d commit cd5ca82

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

llm/predict/export_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def main():
9595
},
9696
)
9797
predictor.model.config.save_pretrained(export_args.output_path)
98+
predictor.model.generation_config.save_pretrained(export_args.output_path)
9899
predictor.tokenizer.save_pretrained(export_args.output_path)
99100
generate_rank_mapping(os.path.join(export_args.output_path, "rank_mapping.csv"))
100101

paddlenlp/transformers/configuration_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,8 @@ def to_dict(self, saving_file=False) -> Dict[str, Any]:
10321032
output["model_type"] = self.__class__.model_type
10331033
if "_auto_class" in output:
10341034
del output["_auto_class"]
1035+
if "moe_group" in output:
1036+
del output["moe_group"]
10351037

10361038
# PaddleNLP version when serializing the model
10371039
output["paddlenlp_version"] = __version__

0 commit comments

Comments
 (0)