Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support XTuner Lite Llava #2191

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lmdeploy/pytorch/configurations/llava_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ def condition(cls, hf_config):
def build(cls, hf_config, model_path: str = None):
"""build llava hf."""
arch = hf_config.architectures[0]
if arch == 'LlavaForConditionalGeneration':
has_remote_code = hasattr(hf_config, 'auto_map')
if has_remote_code:
# HACK: hardcode for XTuner Llava
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we have llava model trained with xtuner to test it ?

# The native HF Llava does not support the part of LLM which is
# remote code.
from transformers import AutoModel as _LlavaModel
elif arch == 'LlavaForConditionalGeneration':
from transformers import \
LlavaForConditionalGeneration as _LlavaModel
elif arch == 'LlavaNextForConditionalGeneration':
Expand Down
Loading