Skip to content

Qwen3.5 lora merge export using wrong keys #9046

@perone

Description

@perone

Checklist / 检查清单

  • I have searched existing issues, and this is a new bug report. / 我已经搜索过现有的 issues,确认这是一个新的 bug report。

Bug Description / Bug 描述

There is a mismatch of the keys when merging the lora adapters for Qwen3.5 27B:

  ┌───────────────────────────────────────────────────────────────┬─────────────────────────────────┐
  │                       Merged checkpoint                       │      Base model (expected)      │
  ├───────────────────────────────────────────────────────────────┼─────────────────────────────────┤
  │ model.language_model.language_model.language_model.layers.X.* │ model.language_model.layers.X.* │
  ├───────────────────────────────────────────────────────────────┼─────────────────────────────────┤
  │ model.language_model.visual.*                                 │ model.visual.*                  │
  ├───────────────────────────────────────────────────────────────┼─────────────────────────────────┤
  │ lm_head.weight                                                │ lm_head.weight (correct)        │
  └───────────────────────────────────────────────────────────────┴─────────────────────────────────┘

That causes issues with vLLM 0.19.0 when loading the exported model. I'm using transformers==5.5.0 and ms-swift commit 0f5fb0083adc7d674c6126bea1a0d2b1e20a1795.

How to Reproduce / 如何复现

Model exported with:

swift export --adapters checkpoint-xxx --merge_lora true --use_hf true

Additional Information / 补充信息

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions