Commit 0bb491f8 authored by 王敏's avatar 王敏
Browse files

更新medusa权重转换脚本

parent 44e3ca68
...@@ -369,7 +369,7 @@ def main(args): ...@@ -369,7 +369,7 @@ def main(args):
os.makedirs(args.output_dir, exist_ok=True) os.makedirs(args.output_dir, exist_ok=True)
save_model(medusa_model, os.path.join(args.output_dir, "model.safetensors")) save_model(medusa_model, os.path.join(args.output_dir, "model.safetensors"))
medusa_choices = ast.literal_eval(args.medusa_choices) medusa_choices = ast.literal_eval(args.medusa_choices) if args.medusa_choices is not None else None
to_save_config = CustomMedusaConfig(name_or_path=os.path.join(args.output_dir, "config.json"), to_save_config = CustomMedusaConfig(name_or_path=os.path.join(args.output_dir, "config.json"),
hidden_size=args.hidden_size, hidden_size=args.hidden_size,
num_heads=medusa_head_num, num_heads=medusa_head_num,
...@@ -403,7 +403,7 @@ if __name__ == "__main__": ...@@ -403,7 +403,7 @@ if __name__ == "__main__":
parser.add_argument( parser.add_argument(
'--medusa_choices', '--medusa_choices',
type=str, type=str,
required=True, default=None,
help="Medusa choice to use, if not none, will use Medusa decoding." help="Medusa choice to use, if not none, will use Medusa decoding."
" E.g.: [[0, 0, 0, 0], [0, 1, 0], [1, 0], [1, 1]] for 9 medusa tokens." " E.g.: [[0, 0, 0, 0], [0, 1, 0], [1, 0], [1, 1]] for 9 medusa tokens."
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment