Instructions to use zhuoyanxu/ada-llava-L-v1.5-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zhuoyanxu/ada-llava-L-v1.5-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="zhuoyanxu/ada-llava-L-v1.5-7b")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("zhuoyanxu/ada-llava-L-v1.5-7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zhuoyanxu/ada-llava-L-v1.5-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zhuoyanxu/ada-llava-L-v1.5-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zhuoyanxu/ada-llava-L-v1.5-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/zhuoyanxu/ada-llava-L-v1.5-7b
- SGLang
How to use zhuoyanxu/ada-llava-L-v1.5-7b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "zhuoyanxu/ada-llava-L-v1.5-7b" \ --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": "zhuoyanxu/ada-llava-L-v1.5-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
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 "zhuoyanxu/ada-llava-L-v1.5-7b" \ --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": "zhuoyanxu/ada-llava-L-v1.5-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use zhuoyanxu/ada-llava-L-v1.5-7b with Docker Model Runner:
docker model run hf.co/zhuoyanxu/ada-llava-L-v1.5-7b
Ada-LLaVA Model Card
Ada-LLaVA-L-7B is an open-source adaptive inference framework for multimodal Large Language Models (MLLMs) that dynamically adjusts its operations based on available computational resources and latency requirements.
See the paper for more details: Learning to Inference Adaptively for Multimodal Large Language Models
Model details: https://zhuoyan-xu.github.io/ada-llava/
Github repository: https://github.com/zhuoyan-xu/AdaLLaVA
Model Details
Model Type: Ada LLaVA 7B follows the LLaVA-v1.5 stage-2 training pipeline, with CLIP-ViT-L-336px as visual encoder (336*336 image resolution), Vicuna-v1.5-7B as base LLM and a two-layer MLP as vision-language connector, customized embedding model and MLP as latency scheduler.
It was trained with stage-2 pipeline as LLaVA:
Instruction tuning: Freeze vision encoder, train the remaining model with multimodal instruction following data of tabular and non-tabular tasks.
Code Base: We use the official code of LLaVA-v1.5 for model training and inference, and the saved model checkpoint is uploaded to this repository.
Model Date: Ada-LLaVA 7B was trained in Oct 2024.
License
AdaLLaVA is based on LLaVA-1.5 and thus follows its license. Llama 2 is licensed under the LLAMA 2 Community License, Copyright (c) Meta Platforms, Inc. All Rights Reserved.
Intended use
Primary intended uses: The primary use of Ada LLaVA is research on multimodal large multimodal models and chatbots, especially for resource-constrain inference and deployment.
Primary intended users: The primary intended users of the model are researchers and hobbyists in computer vision, natural language processing, machine learning, and artificial intelligence.
Training dataset
- 665K image level instruction data from LLaVA-1.5 stage-2, see details in original LLaVA repo.
Limitations
While Ada-LLaVA is currently limited to processing one image at a time and only applies adaptive operations in its later half of layers, future work could explore multi-image input support and extend the adaptive mechanisms throughout the entire model architecture, including the vision encoder. These improvements would make the model more versatile and applicable to a broader range of real-world scenarios.
- Downloads last month
- 7
Model tree for zhuoyanxu/ada-llava-L-v1.5-7b
Base model
liuhaotian/llava-v1.5-7b
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "zhuoyanxu/ada-llava-L-v1.5-7b"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zhuoyanxu/ada-llava-L-v1.5-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'