Skip to content

Commit bdb8f62

Browse files
committed
Merge branch 'main' into stable
2 parents ad34e98 + cf05733 commit bdb8f62

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

loader.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .dequant import is_quantized, dequantize_tensor
99

1010
IMG_ARCH_LIST = {"flux", "sd1", "sdxl", "sd3", "aura", "hidream", "cosmos", "ltxv", "hyvid", "wan", "lumina2", "qwen_image"}
11-
TXT_ARCH_LIST = {"t5", "t5encoder", "llama"}
11+
TXT_ARCH_LIST = {"t5", "t5encoder", "llama", "qwen2vl"}
1212

1313
def get_orig_shape(reader, tensor_name):
1414
field_key = f"comfy.gguf.orig_shape.{tensor_name}"
@@ -244,15 +244,16 @@ def gguf_clip_loader(path):
244244
logging.warning(f"Dequantizing {temb_key} to prevent runtime OOM.")
245245
sd[temb_key] = dequantize_tensor(sd[temb_key], dtype=torch.float16)
246246
sd = sd_map_replace(sd, T5_SD_MAP)
247-
elif arch in {"llama"}:
247+
elif arch in {"llama", "qwen2vl"}:
248248
# TODO: pass model_options["vocab_size"] to loader somehow
249249
temb_key = "token_embd.weight"
250250
if temb_key in sd and sd[temb_key].shape[0] >= (64 * 1024):
251251
# See note above for T5.
252252
logging.warning(f"Dequantizing {temb_key} to prevent runtime OOM.")
253253
sd[temb_key] = dequantize_tensor(sd[temb_key], dtype=torch.float16)
254254
sd = sd_map_replace(sd, LLAMA_SD_MAP)
255-
sd = llama_permute(sd, 32, 8) # L3
255+
if arch == "llama":
256+
sd = llama_permute(sd, 32, 8) # L3
256257
else:
257258
pass
258259
return sd

0 commit comments

Comments
 (0)