From 4b86522f8a43407ee9906a4a012aefe30f77e0b7 Mon Sep 17 00:00:00 2001 From: Daoyuan Li <94409450+DaoyuanLi2816@users.noreply.github.com> Date: Mon, 21 Sep 2026 23:24:55 -0700 Subject: [PATCH] fix: align LoRA inference paths with training output --- eval_llm.py | 2 +- scripts/serve_openai_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eval_llm.py b/eval_llm.py index 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.py index 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)')