Instructions to use BleachNick/MMICL-Instructblip-T5-xxl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BleachNick/MMICL-Instructblip-T5-xxl with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="BleachNick/MMICL-Instructblip-T5-xxl")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("BleachNick/MMICL-Instructblip-T5-xxl") model = AutoModelForImageTextToText.from_pretrained("BleachNick/MMICL-Instructblip-T5-xxl") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use BleachNick/MMICL-Instructblip-T5-xxl with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BleachNick/MMICL-Instructblip-T5-xxl" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BleachNick/MMICL-Instructblip-T5-xxl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BleachNick/MMICL-Instructblip-T5-xxl
- SGLang
How to use BleachNick/MMICL-Instructblip-T5-xxl 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 "BleachNick/MMICL-Instructblip-T5-xxl" \ --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": "BleachNick/MMICL-Instructblip-T5-xxl", "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 "BleachNick/MMICL-Instructblip-T5-xxl" \ --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": "BleachNick/MMICL-Instructblip-T5-xxl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BleachNick/MMICL-Instructblip-T5-xxl with Docker Model Runner:
docker model run hf.co/BleachNick/MMICL-Instructblip-T5-xxl
Missing files
Is this repo missing the data files? When trying to run the example I get an error looking for https://huggingface.co/BleachNick/MMICL-Instructblip-T5-xxl/resolve/main/config.json, and looking at the files there's nothing apart from the README
Sorry, currently the release of my model and data is still in progress, and the maintenance of the repository is not yet complete.
For the config.json file, you can simply use the same file from instructnlip.
You can use the code from our repository,
and try to load the model using the following script:
from model.instructblip import InstructBlipConfig, InstructBlipModel, InstructBlipPreTrainedModel,InstructBlipForConditionalGeneration,InstructBlipProcessor
import transformers
from PIL import Image
import torch
model_ckpt="BleachNick/MMICL-Instructblip-T5-xxl"
config_ckpt = "Salesforce/instructblip-flan-t5-xxl"
config = InstructBlipConfig.from_pretrained(config_ckpt )
model = InstructBlipForConditionalGeneration.from_pretrained(
model_ckpt,
config=config).to('cuda:0')