Instructions to use Salesforce/instructblip-vicuna-13b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Salesforce/instructblip-vicuna-13b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Salesforce/instructblip-vicuna-13b")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Salesforce/instructblip-vicuna-13b") model = AutoModelForMultimodalLM.from_pretrained("Salesforce/instructblip-vicuna-13b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Salesforce/instructblip-vicuna-13b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Salesforce/instructblip-vicuna-13b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Salesforce/instructblip-vicuna-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Salesforce/instructblip-vicuna-13b
- SGLang
How to use Salesforce/instructblip-vicuna-13b 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 "Salesforce/instructblip-vicuna-13b" \ --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": "Salesforce/instructblip-vicuna-13b", "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 "Salesforce/instructblip-vicuna-13b" \ --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": "Salesforce/instructblip-vicuna-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Salesforce/instructblip-vicuna-13b with Docker Model Runner:
docker model run hf.co/Salesforce/instructblip-vicuna-13b
Commit ·
3f553d4
1
Parent(s): c2ef27c
add pipeline
Browse files- README.md +1 -1
- config.json +0 -3
README.md
CHANGED
|
@@ -4,7 +4,7 @@ license: other
|
|
| 4 |
tags:
|
| 5 |
- vision
|
| 6 |
- image-captioning
|
| 7 |
-
pipeline_tag: image-to-text
|
| 8 |
---
|
| 9 |
|
| 10 |
# InstructBLIP model
|
|
|
|
| 4 |
tags:
|
| 5 |
- vision
|
| 6 |
- image-captioning
|
| 7 |
+
pipeline_tag: image-text-to-text
|
| 8 |
---
|
| 9 |
|
| 10 |
# InstructBLIP model
|
config.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "/raid/raushan/instructblip-vicuna-13b/",
|
| 3 |
"architectures": [
|
| 4 |
"InstructBlipForConditionalGeneration"
|
| 5 |
],
|
|
@@ -9,7 +8,6 @@
|
|
| 9 |
"model_type": "instructblip",
|
| 10 |
"num_query_tokens": 32,
|
| 11 |
"qformer_config": {
|
| 12 |
-
"_attn_implementation_autoset": true,
|
| 13 |
"model_type": "instructblip_qformer",
|
| 14 |
"vocab_size": 30523
|
| 15 |
},
|
|
@@ -46,7 +44,6 @@
|
|
| 46 |
"use_decoder_only_language_model": true,
|
| 47 |
"video_token_index": 32002,
|
| 48 |
"vision_config": {
|
| 49 |
-
"_attn_implementation_autoset": true,
|
| 50 |
"model_type": "instructblip_vision_model"
|
| 51 |
}
|
| 52 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"InstructBlipForConditionalGeneration"
|
| 4 |
],
|
|
|
|
| 8 |
"model_type": "instructblip",
|
| 9 |
"num_query_tokens": 32,
|
| 10 |
"qformer_config": {
|
|
|
|
| 11 |
"model_type": "instructblip_qformer",
|
| 12 |
"vocab_size": 30523
|
| 13 |
},
|
|
|
|
| 44 |
"use_decoder_only_language_model": true,
|
| 45 |
"video_token_index": 32002,
|
| 46 |
"vision_config": {
|
|
|
|
| 47 |
"model_type": "instructblip_vision_model"
|
| 48 |
}
|
| 49 |
}
|