vllm - ✅(Solved) Fix [Transformers v5] HCXVisionForCausalLM [2 pull requests, 10 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#38387Fetched 2026-04-08 01:41:37
View on GitHub
Comments
10
Participants
4
Timeline
41
Reactions
0
Author
Assignees
Timeline (top)
mentioned ×11subscribed ×11commented ×10cross-referenced ×3

Error Message

$ pytest tests/models/test_initialization.py::test_can_initialize_large_subset[HCXVisionForCausalLM] ... AttributeError: 'HCXVisionConfig' object has no attribute 'text_config'

PR fix notes

PR #38447: [Transformers v5] Vendor HCXVisionConfig for compatibility

Description (problem / solution / changelog)

Purpose

Vendor the HyperCLOVAX Vision config into vLLM to fix transformers v5 compatibility.

The upstream remote code config does not handle empty initialization (text_config=None), which breaks transformers v5's @strict config validation (huggingface/transformers#41250).

Root cause: HCXVisionConfig.__init__ only sets self.text_config when text_config is not None. When transformers v5 creates an empty config for validation/diffing, get_text_config() crashes with AttributeError.

Fix: Vendor the config with self.text_config = None always initialized, and get_text_config() falling back to self when text_config is None.

Fixes: #38387

TODO: Remove vendored config once HCXVision is upstreamed to transformers. @bigshanedogg is also fixing the remote code on HF Hub in parallel.

Related:

  • huggingface/transformers#45093 — AutoConfig.register() precedence fix (merged in huggingface/transformers#45094)
  • huggingface/transformers#44956 — HyperCLOVAX (text model) upstream PR

Test Plan

pytest tests/models/test_initialization.py::test_can_initialize_large_subset[HCXVisionForCausalLM] -v

Requires transformers v5 (or latest main which includes huggingface/transformers#45094).

Test Result

tests/models/test_initialization.py::test_can_initialize_large_subset[HCXVisionForCausalLM] PASSED [100%]
======================= 1 passed, 17 warnings in 14.89s ========================

Changed files

  • vllm/transformers_utils/config.py (modified, +5/-3)
  • vllm/transformers_utils/configs/__init__.py (modified, +2/-0)
  • vllm/transformers_utils/configs/hyperclovax.py (modified, +74/-0)

Code Example

$ pytest tests/models/test_initialization.py::test_can_initialize_large_subset[HCXVisionForCausalLM]
...
AttributeError: 'HCXVisionConfig' object has no attribute 'text_config'

---

# Or your fork
git clone https://github.com/huggingface/transformers.git
git clone https://github.com/vllm-project/vllm.git

cd vllm
VLLM_USE_PRECOMPILED=1 uv pip install -e .
uv pip install -e ../transformers
RAW_BUFFERClick to expand / collapse

This is a sub-issue forming part of the work in https://github.com/vllm-project/vllm/issues/38379, please read the description of this issue before beginning to work on this one.

Which test is failing?

This one we either drop from vLLM or upstream to Transformers

$ pytest tests/models/test_initialization.py::test_can_initialize_large_subset[HCXVisionForCausalLM]
...
AttributeError: 'HCXVisionConfig' object has no attribute 'text_config'

How to configure my environment?

It's very important that you install both vLLM and Transformers from source so that your test results reflect the current state of both libraries.

# Or your fork
git clone https://github.com/huggingface/transformers.git
git clone https://github.com/vllm-project/vllm.git

cd vllm
VLLM_USE_PRECOMPILED=1 uv pip install -e .
uv pip install -e ../transformers

extent analysis

Fix Plan

The fix involves adding a text_config attribute to the HCXVisionConfig class.

Steps to Fix

  • Open the HCXVisionConfig class definition in the relevant file.
  • Add a text_config attribute to the class, for example:
class HCXVisionConfig:
    # existing attributes...
    def __init__(self, **kwargs):
        # existing initialization code...
        self.text_config = None  # or initialize with a default value

Alternatively, if the text_config attribute is supposed to be initialized from a specific configuration, modify the __init__ method to accept and set this attribute:

class HCXVisionConfig:
    # existing attributes...
    def __init__(self, text_config=None, **kwargs):
        # existing initialization code...
        self.text_config = text_config
  • Update any relevant tests or code that uses the HCXVisionConfig class to ensure they correctly set or access the text_config attribute.

Verification

To verify the fix, run the failing test again:

pytest tests/models/test_initialization.py::test_can_initialize_large_subset[HCXVisionForCausalLM]

If the fix is correct, the test should pass without raising an AttributeError.

Extra Tips

  • Make sure to update any documentation or type hints to reflect the addition of the text_config attribute.
  • Consider adding a default value or validation for the text_config attribute to ensure it is properly initialized and used.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - ✅(Solved) Fix [Transformers v5] HCXVisionForCausalLM [2 pull requests, 10 comments, 4 participants]