Skip to content

[BUG] Multimodal processor loading ignores the checkpoint subfolder #5358

Closed

Description

@Qubitium

Describe the bug

Loading a multimodal checkpoint with GPTQModel.load(parent, subfolder="nested") finds the selected model config, tokenizer and weights, then looks for processor files at parent. With the checkpoint stored entirely in parent/nested, this raises ValueError: Unrecognized processing class.

To reproduce

Place a local Gemma3ForConditionalGeneration checkpoint and the files written by Gemma3Processor.save_pretrained() together in parent/nested. Leave the parent directory without model or processor files.

from pathlib import Path

from gptqmodel import GPTQModel
from transformers import AutoProcessor

parent = Path("parent")
print(type(AutoProcessor.from_pretrained(parent, subfolder="nested")).__name__)
print(type(GPTQModel.load(str(parent / "nested"), device="cpu").processor).__name__)
GPTQModel.load(str(parent), subfolder="nested", device="cpu")

The two controls return Gemma3Processor. The final call raises after loading model weights. Verified on CPU at 72cef9bac with Transformers 5.23.0, using a locally generated one-layer Gemma 3 text and vision checkpoint and a local WordLevel tokenizer.

Expected behavior

The model and processor come from the same selected checkpoint directory.

Additional context

The dense loader forwards the requested subfolder to the Transformers model loader, then initializes the wrapper with the root path only. The wrapper's AutoProcessor.from_pretrained() call has no subfolder. The quantized wrapper construction has the same path handoff by inspection. Model and wrapper construction, processor load, quantized wrapper construction.

Suggested mitigation

The loader in gptqmodel/models/loader.py could pass the effective checkpoint path to BaseQModel for processor lookup. Forwarding the applicable subfolder and revision to AutoProcessor from gptqmodel/models/base.py would also work if the wrapper needs to retain the snapshot root for other resources.

A useful control is a root containing a different valid processor so the test detects a silent root fallback. Passing the resolved nested directory directly works for a local checkpoint.

Activity

  1. added
    bug
    on Nov 19, 2026
  2. ZX-ModelCloud commented on Nov 19, 2026

    @ZX-ModelCloud
    Collaborator

    Agent claim released: agent-f59bb1f98909 finished this issue.

    Pull request: #5461

    Reproducing subfolder processor load and adding regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions