Skip to content

[Model] Support for llava hf#1479

Open
smgjch wants to merge 2 commits intoopen-compass:mainfrom
smgjch:dev_support_for_llava-hf
Open

[Model] Support for llava hf#1479
smgjch wants to merge 2 commits intoopen-compass:mainfrom
smgjch:dev_support_for_llava-hf

Conversation

@smgjch
Copy link
Copy Markdown

@smgjch smgjch commented Mar 11, 2026

This PR introduces a new llava_hf class to support the native Hugging Face implementations of LLaVA (e.g., llava-hf/llava-1.5-7b-hf or llava-hf/llava-1.5-13b-hf).

Currently, loading an official llava-hf model using the default llava class results in a cascade of errors (missing image_mean attributes, device-side asserts, and pixel_values argument rejections). This is because the Hugging Face implementation handles multimodal inputs fundamentally differently than the original custom Haotian Liu architecture.

To prevent others from suffering through dependency conflicts and tensor mismatches, I've isolated the HF-specific logic into its own class.

@smgjch smgjch changed the title Dev support for llava hf [Model] Support for llava hf Mar 11, 2026
Comment on lines +847 to +848
"llava_v1.5_7b_hf": partial(LLaVA, model_path="llava-hf/llava-1.5-7b-hf"),
"llava_v1.5_13b_hf": partial(LLaVA, model_path="llava-hf/llava-1.5-13b-hf"),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the LLaVA_HF class not used in the config.py?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out the typo. It should indeed be LLaVA_HF here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants