Skip to content

[TEST] tests/test_local_model_paths.py red on main: the nine DummyQModel doubles never declared require_load_tokenizer (#4894 follow-up) #4923

Closed

Description

@Qubitium

main @ 5a13ec241 has 11 red nodes in tests/test_local_model_paths.py:

$ python -m pytest tests/test_local_model_paths.py -q
11 failed, 18 passed
E   AttributeError: type object 'DummyQModel' has no attribute 'require_load_tokenizer'

Affected nodes: test_model_loader_requires_lazy_turtle_for_offload_to_disk, test_model_loader_uses_lazy_turtle_for_local_safetensors, test_model_loader_from_pretrained_forwards_dtype_kwarg, test_model_loader_from_pretrained_normalizes_direct_gguf_path, the two native_bonsai_fast_profiles_use_dense_path cases, native_bonsai_fast_auto_enables_fa2_on_cuda, native_bonsai_fast_keeps_explicit_attn_impl, the two native_bonsai_low_memory_redirects_with_backend cases, and falls_back_when_meta_shell_build_hits_meta_tensor_item.

Cause

#4894 (Decision Transformer) made the loader read cls.require_load_tokenizer:

  • gptqmodel/models/loader.py:2056 and :2691 — if cls.require_load_tokenizer:
  • gptqmodel/models/base.py:847 — require_load_tokenizer: bool = True (the BaseQModel default)
  • gptqmodel/models/definitions/decision_transformer.py:33 — require_load_tokenizer = False

The nine DummyQModel doubles in tests/test_local_model_paths.py are bare classes that mirror BaseQModel's attributes by hand (require_dtype, require_fast_init, require_trust_remote_code, require_pkgs, support_offload_to_disk, ...) but were never updated with the new attribute. Real model classes all inherit the default, so this is a test-double gap, not a product bug — but it makes the file red on main and it will hit every branch that touches the loader.

Fix

Declare require_load_tokenizer = True on each DummyQModel (the BaseQModel default). With that, tests/test_local_model_paths.py goes to 29 passed.

A follow-up could make the doubles inherit from a shared stub or use getattr(cls, "require_load_tokenizer", True) in the loader, but the loader should keep treating a definition attribute as required for real classes.

Activity

  1. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim: agent-root-4923 is working on this issue now.

  2. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Fixed by #4926 (squash-merged, 83f9180ac). The nine DummyQModel doubles now declare require_load_tokenizer = True (BaseQModel's default); tests/test_local_model_paths.py goes from 11 failed / 18 passed to 29 passed, with and without tokenicer 0.0.19 on the path.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions