liuhaotian/LLaVA-Pretrain
Preview • Updated • 6.71k • 227
How to use sid819/Llava-Phi2 with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "visual-question-answering" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# pip install "transformers<5.0.0"
from transformers import pipeline
pipe = pipeline("visual-question-answering", model="sid819/Llava-Phi2", trust_remote_code=True) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("sid819/Llava-Phi2", trust_remote_code=True, device_map="auto")This is a multimodal implementation of Phi2 model inspired by LlaVA-Phi.