LLaVA-NeXT icon indicating copy to clipboard operation
LLaVA-NeXT copied to clipboard

cannot import name 'LlavaLlamaForCausalLM' from 'llava.model'

Open MKdir98 opened this issue 1 year ago • 2 comments

I'm getting this error in example code of llava-next

ImportError                               Traceback (most recent call last)
Cell In[5], line 1
----> 1 from llava.model.builder import load_pretrained_model
      2 from llava.mm_utils import get_model_name_from_path, process_images, tokenizer_image_token
      3 from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN, IGNORE_INDEX

File /opt/conda/lib/python3.10/site-packages/llava/model/builder.py:23
     21 import torch
     22 from llava.model import *
---> 23 from llava.constants import DEFAULT_IMAGE_PATCH_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
     24 from llava.utils import rank0_print
     27 def load_pretrained_model(model_path, model_base, model_name, load_8bit=False, load_4bit=False, device_map="auto", attn_implementation="flash_attention_2", customized_config=None, **kwargs):

File /opt/conda/lib/python3.10/site-packages/llava/__init__.py:1
----> 1 from .model import LlavaLlamaForCausalLM

ImportError: cannot import name 'LlavaLlamaForCausalLM' from 'llava.model' (/opt/conda/lib/python3.10/site-packages/llava/model/__init__.py)

MKdir98 avatar May 20 '24 08:05 MKdir98

https://github.com/LLaVA-VL/LLaVA-NeXT/pull/29

MKdir98 avatar May 20 '24 08:05 MKdir98

Is it something that related to this issue https://github.com/haotian-liu/LLaVA/issues/1101?

kcz358 avatar May 22 '24 12:05 kcz358