llava
यह क्या करती है
यह स्किल LLaVA समझाती है, एक ओपन-सोर्स असिस्टेंट जो छवियाँ देख सकता है और उनके बारे में बात कर सकता है। यह उन डेवलपर्स के लिए है जो छवि चैटबॉट या छवि विश्लेषण टूल बना रहे हैं।
कब इस्तेमाल करें
- ✓जब आपको ऐसा चैटबॉट चाहिए जो एक छवि के बारे में कई संदेशों में सवालों के जवाब दे।
- ✓जब आपको होस्ट की गई vision chat APIs का मुफ़्त, ओपन-सोर्स विकल्प चाहिए।
- ✓जब आप चाहते हैं कि मॉडल ऐसे दस्तावेज़ों का विवरण या विश्लेषण करे जिनमें छवियाँ हों।
Skill का लिंक
https://github.com/Orchestra-Research/AI-Research-SKILLs/blob/main/18-multimodal/llava/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“ऐसा चैट टूल बनाइए जहाँ मैं एक चार्ट अपलोड करूँ और उसके बारे में आगे के सवाल पूछ सकूँ।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
LLaVA एक CLIP इमेज encoder को Vicuna या LLaMA भाषा मॉडल से जोड़ता है। आप एक पहले से ट्रेन checkpoint लोड करते हैं, एक छवि और संदेश देते हैं, और मॉडल बातचीत में जवाब देता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
LLaVA - Large Language and Vision Assistant
Open-source vision-language model for conversational image understanding.
When to use LLaVA
Use when:
- Building vision-language chatbots
- Visual question answering (VQA)
- Image description and captioning
- Multi-turn image conversations
- Visual instruction following
- Document understanding with images
Metrics:
- 23,000+ GitHub stars
- GPT-4V level capabilities (targeted)
- Apache 2.0 License
- Multiple model sizes (7B-34B params)
Use alternatives instead:
- GPT-4V: Highest quality, API-based
- CLIP: Simple zero-shot classification
- BLIP-2: Better for captioning only
- Flamingo: Research, not open-source
Quick start
Installation
# Clone repository
git clone https://github.com/haotian-liu/LLaVA
cd LLaVA
# Install
pip install -e .
Basic usage
from llava.model.builder import load_pretrained_model
from llava.mm_utils import get_model_name_from_path, process_images, tokenizer_image_token
from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN
from llava.conversation import conv_templates
from PIL import Image
import torch
# Load model
model_path = "liuhaotian/llava-v1.5-7b"
tokenizer, model, image_processor, context_len = load_pretrained_model(
model_path=model_path,
model_base=None,
model_name=get_model_name_from_path(model_path)
)
# Load image
image = Image.open("image.jpg")
image_tensor = process_images([image], image_processor, model.config)
image_tensor = image_tensor.to(model.device, dtype=torch.float16)
# Create conversation
conv = conv_templates["llava_v1"].copy()
conv.append_message(conv.roles[0], DEFAULT_IMAGE_TOKEN + "\nWhat is in this image?")
conv.append_message(conv.roles[1], None)
prompt = conv.get_prompt()
# Generate response
input_ids = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).to(model.device)
with torch.inference_mode():
output_ids = model.generate(
input_ids,
images=image_tensor,
do_sample=True,
temperature=0.2,
max_new_tokens=512
)
response = tokenizer.decode(output_ids[0], skip_special_tokens=True).strip()
print(response)
Available models
| Model | Parameters | VRAM | Quality |
|---|---|---|---|
| LLaVA-v1.5-7B | 7B | ~14 GB | Good |
| LLaVA-v1.5-13B | 13B | ~28 GB | Better |
| LLaVA-v1.6-34B | 34B | ~70 GB | Best |
# Load different models
model_7b = "liuhaotian/llava-v1.5-7b"
model_13b = "liuhaotian/llava-v1.5-13b"
model_34b = "liuhaotian/llava-v1.6-34b"
# 4-bit quantization for lower VRAM
load_4bit = True # Reduces VRAM by ~4×
CLI usage
# Single image query
python -m llava.serve.cli \
--model-path liuhaotian/llava-v1.5-7b \
--image-file image.jpg \
--query "What is in this image?"
# Multi-turn conversation
python -m llava.serve.cli \
--model-path liuhaotian/llava-v1.5-7b \
--image-file image.jpg
# Then type questions interactively
Web UI (Gradio)
# Launch Gradio interface
python -m llava.serve.gradio_web_server \
--model-path liuhaotian/llava-v1.5-7b \
--load-4bit # Optional: reduce VRAM
# Access at http://localhost:7860
Multi-turn conversations
# Initialize conversation
conv = conv_templates["llava_v1"].copy()
# Turn 1
conv.append_message(conv.roles[0], DEFAULT_IMAGE_TOKEN + "\nWhat is in this image?")
conv.append_message(conv.roles[1], None)
response1 = generate(conv, model, image) # "A dog playing in a park"
# Turn 2
conv.messages[-1][1] = response1 # Add previous response
conv.append_message(conv.roles[0], "What breed is the dog?")
conv.append_message(conv.roles[1], None)
response2 = generate(conv, model, image) # "Golden Retriever"
# Turn 3
conv.messages[-1][1] = response2
conv.append_message(conv.roles[0], "What time of day is it?")
conv.append_message(conv.roles[1], None)
response3 = generate(conv, model, image)
Common tasks
Image captioning
question = "Describe this image in detail."
response = ask(model, image, question)
Visual question answering
question = "How many people are in the image?"
response = ask(model, image, question)
Object detection (textual)
question = "List all the objects you can see in this image."
response = ask(model, image, question)
Scene understanding
question = "What is happening in this scene?"
r
अक्सर पूछे जाने वाले सवाल
कौन से आकार उपलब्ध हैं?
स्किल बताती है कि मॉडल आकार लगभग 7 अरब से 34 अरब पैरामीटर तक हैं।
यह कौन सा लाइसेंस इस्तेमाल करता है?
स्किल Apache 2.0 लाइसेंस की सूची देती है।
सरल वर्गीकरण के लिए कौन सा टूल बेहतर है?
बिना प्रशिक्षण के सरल zero-shot वर्गीकरण के लिए स्किल CLIP सुझाती है।
जानकारी
लेखक का मूल विवरण
Large Language and Vision Assistant. Enables visual instruction tuning and image-based conversations. Combines CLIP vision encoder with Vicuna/LLaMA language models. Supports multi-turn image chat, visual question answering, and instruction following. Use for vision-language chatbots or image understanding tasks. Best for conversational image analysis.
लोकप्रियता
- GitHub स्टार
- 14k
- रैंकिंग में स्थान
- #11235
- लाइसेंस
- MIT
- अपडेट की गई
- 10/10/2026
कमेंट
- …
इस repository की और skills
autoresearch
14kयह आपके एजेंट को साहित्य समीक्षा से प्रयोग और लेखन तक पूरे AI रिसर्च प्रोजेक्ट में मार्गदर्शन देती है, परीक्षण और समीक्षा के दोहराने वाले चक्र के साथ।
prompt-guard
14kयह आपके एजेंट को Meta के छोटे classifier से टेक्स्ट को AI ऐप तक पहुँचने से पहले prompt injection और jailbreak कोशिशों के लिए जाँचने देती है।
pytorch-fsdp2
14kयह आपके एजेंट को दिखाती है कि ट्रेनिंग स्क्रिप्ट में PyTorch FSDP2 कैसे जोड़ें, ताकि बड़े मॉडल GPU पर बँटें और सही तरीके से सेव हों।
ml-training-recipes
14kयह आपके एजेंट को न्यूरल नेटवर्क के लिए परखे हुए ट्रेनिंग तरीके देती है, जिनमें मॉडल चुनाव, optimizers, learning rates और loss spikes ठीक करना शामिल है।
मिलती-जुलती skills
pytorch-patterns
280kआपके एजेंट को machine learning models के लिए PyTorch इस्तेमाल करने में मदद करता है। कुशल model training के best practices लागू करता है और नतीजों को दोहराने लायक रखता है।
evm-token-decimals
280kयह आपके एजेंट को अलग-अलग blockchain networks पर decimal numbers की गलतियों से बचने में मदद करता है। यह transactions और calculations में token values सही रखने का ध्यान रखता है।
ito-inference
280kआपके एजेंट को AI models की उपलब्धता जाँचने देता है। यह compute request को तैयार model service से जोड़ता है।