Instructions to use TIGER-Lab/Mantis-llava-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TIGER-Lab/Mantis-llava-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="TIGER-Lab/Mantis-llava-7b")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("TIGER-Lab/Mantis-llava-7b") model = AutoModelForImageTextToText.from_pretrained("TIGER-Lab/Mantis-llava-7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TIGER-Lab/Mantis-llava-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TIGER-Lab/Mantis-llava-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TIGER-Lab/Mantis-llava-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TIGER-Lab/Mantis-llava-7b
- SGLang
How to use TIGER-Lab/Mantis-llava-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 "TIGER-Lab/Mantis-llava-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": "TIGER-Lab/Mantis-llava-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 "TIGER-Lab/Mantis-llava-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": "TIGER-Lab/Mantis-llava-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TIGER-Lab/Mantis-llava-7b with Docker Model Runner:
docker model run hf.co/TIGER-Lab/Mantis-llava-7b
Update Processor
Browse files- README.md +1 -1
- added_tokens.json +4 -0
- preprocessor_config.json +1 -1
- tokenizer.model +3 -0
- tokenizer_config.json +1 -1
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
-
base_model: llava-hf/llava-1.5-7b-hf
|
| 3 |
tags:
|
| 4 |
- generated_from_trainer
|
|
|
|
| 5 |
model-index:
|
| 6 |
- name: llava_1.5_7b_v2_4096
|
| 7 |
results: []
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
tags:
|
| 3 |
- generated_from_trainer
|
| 4 |
+
base_model: llava-hf/llava-1.5-7b-hf
|
| 5 |
model-index:
|
| 6 |
- name: llava_1.5_7b_v2_4096
|
| 7 |
results: []
|
added_tokens.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"<image>": 32000,
|
| 3 |
+
"<pad>": 32001
|
| 4 |
+
}
|
preprocessor_config.json
CHANGED
|
@@ -36,7 +36,7 @@
|
|
| 36 |
0.26130258,
|
| 37 |
0.27577711
|
| 38 |
],
|
| 39 |
-
"processor_class": "
|
| 40 |
"resample": 3,
|
| 41 |
"rescale_factor": 0.00392156862745098,
|
| 42 |
"size": {
|
|
|
|
| 36 |
0.26130258,
|
| 37 |
0.27577711
|
| 38 |
],
|
| 39 |
+
"processor_class": "LlavaProcessor",
|
| 40 |
"resample": 3,
|
| 41 |
"rescale_factor": 0.00392156862745098,
|
| 42 |
"size": {
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
| 3 |
+
size 499723
|
tokenizer_config.json
CHANGED
|
@@ -50,7 +50,7 @@
|
|
| 50 |
"model_max_length": 1000000000000000019884624838656,
|
| 51 |
"pad_token": "<pad>",
|
| 52 |
"padding_side": "left",
|
| 53 |
-
"processor_class": "
|
| 54 |
"sp_model_kwargs": {},
|
| 55 |
"tokenizer_class": "LlamaTokenizer",
|
| 56 |
"trust_remote_code": false,
|
|
|
|
| 50 |
"model_max_length": 1000000000000000019884624838656,
|
| 51 |
"pad_token": "<pad>",
|
| 52 |
"padding_side": "left",
|
| 53 |
+
"processor_class": "LlavaProcessor",
|
| 54 |
"sp_model_kwargs": {},
|
| 55 |
"tokenizer_class": "LlamaTokenizer",
|
| 56 |
"trust_remote_code": false,
|