Skip to content
Commit df8939fe authored by Stefy Lanza (nextime / spora )'s avatar Stefy Lanza (nextime / spora )
Browse files

loras: peft↔️gptqmodel AWQ compat shim (fixes add_adapter ImportError)



LoRA add_adapter() crashed: peft's dispatch_awq does `from
gptqmodel.nn_modules.qlinear.gemm_awq import AwqGEMMQuantLinear`, but gptqmodel
7.1.0 renamed that class to AwqGEMMLinear. peft calls dispatch_awq for ANY non-bnb
target when gptqmodel is installed, so the failed import broke every add_adapter
(SDXL/Wan/Z-Image), not just AWQ models.

Add _ensure_peft_awq_compat(): alias AwqGEMMQuantLinear -> AwqGEMMLinear so peft's
import succeeds and falls through to the correct dispatcher. Called before every
add_adapter() (sd15/sdxl/dit/wan).

Co-Authored-By: default avatarClaude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RdMufYvtTbtGDWsiZVoXce
parent ff6002d6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment