This commit is contained in:
mi804
2026-04-23 17:31:34 +08:00
parent 394db06d86
commit a80fb84220
14 changed files with 99 additions and 243 deletions

View File

@@ -1,28 +1,4 @@
"""
State dict converter for ACE-Step Text Encoder (Qwen3-Embedding-0.6B).
The safetensors stores Qwen3Model weights with keys:
embed_tokens.weight
layers.0.self_attn.q_proj.weight
norm.weight
AceStepTextEncoder wraps a .model attribute (Qwen3Model), so its
state_dict() has keys with 'model.' prefix:
model.embed_tokens.weight
model.layers.0.self_attn.q_proj.weight
model.norm.weight
This converter adds 'model.' prefix to match the nested structure.
"""
def ace_step_text_encoder_converter(state_dict):
"""
Convert ACE-Step Text Encoder checkpoint keys to match Qwen3Model wrapped state dict.
参数 state_dict 是 DiskMap 类型。
遍历时key 是 key 名state_dict[key] 获取实际值。
"""
def AceStepTextEncoderStateDictConverter(state_dict):
new_state_dict = {}
prefix = "model."
nested_prefix = "model.model."