diff --git a/loader.py b/loader.py index fbc2716..af86bd3 100644 --- a/loader.py +++ b/loader.py @@ -244,8 +244,12 @@ def gguf_clip_loader(path): elif arch in {"llama"}: temb_key = "token_embd.weight" if temb_key in sd and sd[temb_key].shape != (128320, 4096): - # This still works. Raise error? + # This still works. TODO: Only relevant for llava? logging.warning("Warning! token_embd shape may be incorrect for llama 3 model!") + if temb_key in sd and sd[temb_key].shape[0] >= (64 * 1024): + # See note above for T5. + logging.warning(f"Dequantizing {temb_key} to prevent runtime OOM.") + sd[temb_key] = dequantize_tensor(sd[temb_key], dtype=torch.float16) sd = sd_map_replace(sd, LLAMA_SD_MAP) sd = llama_permute(sd, 32, 8) # L3 else: