🧠 两小时从 0 训出你的 64M 大模型。Train your own 64M LLM from scratch in 2 hours.
fix: align LoRA inference paths with training output
Daoyuan Li4b86522f8a43
diff --git a/eval_llm.py b/eval_llm.pyindex 13b076c..6339711 100755--- a/eval_llm.py+++ b/eval_llm.py@@ -23,7 +23,7 @@ def init_model(args):model.load_state_dict(torch.load(ckp, map_location=args.device), strict=True)if args.lora_weight != 'None':apply_lora(model)- load_lora(model, f'./{args.save_dir}/{args.lora_weight}_{args.hidden_size}.pth')+ load_lora(model, f'./{args.save_dir}/{args.lora_weight}_{args.hidden_size}{moe_suffix}.pth')else:model = AutoModelForCausalLM.from_pretrained(args.load_from, trust_remote_code=True)get_model_params(model, model.config)diff --git a/scripts/serve_openai_api.py b/scripts/serve_openai_api.pyindex e9cf871..09e7fc1 100644--- a/scripts/serve_openai_api.py+++ b/scripts/serve_openai_api.py@@ -40,7 +40,7 @@ def init_model(args):model.load_state_dict(torch.load(ckp, map_location=device), strict=True)if args.lora_weight != 'None':apply_lora(model)- load_lora(model, f'../{args.save_dir}/lora/{args.lora_weight}_{args.hidden_size}.pth')+ load_lora(model, f'../{args.save_dir}/{args.lora_weight}_{args.hidden_size}{moe_suffix}.pth')else:model = AutoModelForCausalLM.from_pretrained(args.load_from, trust_remote_code=True)print(f'MiniMind模型参数量: {sum(p.numel() for p in model.parameters()) / 1e6:.2f} M(illion)')