Multimodal-Fatima/FGVC_Aircraft_train
Viewer • Updated • 3.33k • 979 • 1
How to use takara-ai/pixtral_aerial_VQA_adapter with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="takara-ai/pixtral_aerial_VQA_adapter") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("takara-ai/pixtral_aerial_VQA_adapter", device_map="auto")How to use takara-ai/pixtral_aerial_VQA_adapter with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "takara-ai/pixtral_aerial_VQA_adapter"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "takara-ai/pixtral_aerial_VQA_adapter",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/takara-ai/pixtral_aerial_VQA_adapter
How to use takara-ai/pixtral_aerial_VQA_adapter with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "takara-ai/pixtral_aerial_VQA_adapter" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "takara-ai/pixtral_aerial_VQA_adapter",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "takara-ai/pixtral_aerial_VQA_adapter" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "takara-ai/pixtral_aerial_VQA_adapter",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use takara-ai/pixtral_aerial_VQA_adapter with Docker Model Runner:
docker model run hf.co/takara-ai/pixtral_aerial_VQA_adapter
This repository contains a fine-tuned LoRA adapter for the Pixtral-12B model, optimized specifically for aerial imagery analysis and visual question answering. The adapter enables detailed processing of aerial footage with a focus on construction site surveying, structural assessment, and environmental monitoring.
The adapter enhances Pixtral's ability to:
from transformers import AutoProcessor, AutoModelForCausalLM
import torch
from PIL import Image
# Load model and processor
model_id = "takara-ai/pixtral_aerial_VQA_adapter"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# Load and process image
image = Image.open("path_to_aerial_image.jpg")
prompt = "Describe the construction progress visible in this aerial image."
# Generate response
inputs = processor(text=prompt, images=image, return_tensors="pt").to(model.device)
generated_ids = model.generate(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.7
)
response = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
@misc{rahnemoonfar2020floodnet,
title={FloodNet: A High Resolution Aerial Imagery Dataset for Post Flood Scene Understanding},
author={Maryam Rahnemoonfar and Tashnim Chowdhury and Argho Sarkar and Debvrat Varshney and Masoud Yari and Robin Murphy},
year={2020},
eprint={2012.02951},
archivePrefix={arXiv},
primaryClass={cs.CV},
doi={10.48550/arXiv.2012.02951}
}
For research inquiries and press, please reach out to research@takara.ai
人類を変革する
Base model
mistralai/Pixtral-12B-Base-2409