Instructions to use Hemachandiran/llava_Openvino_INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hemachandiran/llava_Openvino_INT4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Hemachandiran/llava_Openvino_INT4")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Hemachandiran/llava_Openvino_INT4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Hemachandiran/llava_Openvino_INT4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Hemachandiran/llava_Openvino_INT4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hemachandiran/llava_Openvino_INT4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Hemachandiran/llava_Openvino_INT4
- SGLang
How to use Hemachandiran/llava_Openvino_INT4 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 "Hemachandiran/llava_Openvino_INT4" \ --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": "Hemachandiran/llava_Openvino_INT4", "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 "Hemachandiran/llava_Openvino_INT4" \ --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": "Hemachandiran/llava_Openvino_INT4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Hemachandiran/llava_Openvino_INT4 with Docker Model Runner:
docker model run hf.co/Hemachandiran/llava_Openvino_INT4
Download token_embed.xml from Hemachandiran/llava_Openvino_INT4: direct link, hf CLI and curl.
- Browser
- Download file 2.99 kB
-
https://huggingface.co/Hemachandiran/llava_Openvino_INT4/resolve/main/token_embed.xml
- Command line
-
hf download hf://Hemachandiran/llava_Openvino_INT4/token_embed.xml
-
curl -L -o token_embed.xml https://huggingface.co/Hemachandiran/llava_Openvino_INT4/resolve/main/token_embed.xml
2.99 kB
| <net name="Model3" version="11"> | |
| <layers> | |
| <layer id="0" name="x" type="Parameter" version="opset1"> | |
| <data shape="?,?" element_type="i64" /> | |
| <output> | |
| <port id="0" precision="I64" names="x"> | |
| <dim>-1</dim> | |
| <dim>-1</dim> | |
| </port> | |
| </output> | |
| </layer> | |
| <layer id="1" name="Constant_82031_compressed" type="Const" version="opset1"> | |
| <data element_type="f16" shape="50282, 4096" offset="0" size="411910144" /> | |
| <output> | |
| <port id="0" precision="FP16" names="7,weight"> | |
| <dim>50282</dim> | |
| <dim>4096</dim> | |
| </port> | |
| </output> | |
| </layer> | |
| <layer id="2" name="Constant_82031" type="Convert" version="opset1"> | |
| <data destination_type="f32" /> | |
| <rt_info> | |
| <attribute name="decompression" version="0" /> | |
| </rt_info> | |
| <input> | |
| <port id="0" precision="FP16"> | |
| <dim>50282</dim> | |
| <dim>4096</dim> | |
| </port> | |
| </input> | |
| <output> | |
| <port id="1" precision="FP32"> | |
| <dim>50282</dim> | |
| <dim>4096</dim> | |
| </port> | |
| </output> | |
| </layer> | |
| <layer id="3" name="__module.transformer.wte/aten::embedding/Convert" type="Convert" version="opset1"> | |
| <data destination_type="i32" /> | |
| <input> | |
| <port id="0" precision="I64"> | |
| <dim>-1</dim> | |
| <dim>-1</dim> | |
| </port> | |
| </input> | |
| <output> | |
| <port id="1" precision="I32"> | |
| <dim>-1</dim> | |
| <dim>-1</dim> | |
| </port> | |
| </output> | |
| </layer> | |
| <layer id="4" name="__module.transformer.wte/aten::embedding/Constant" type="Const" version="opset1"> | |
| <data element_type="i32" shape="" offset="411910144" size="4" /> | |
| <output> | |
| <port id="0" precision="I32" /> | |
| </output> | |
| </layer> | |
| <layer id="5" name="__module.transformer.wte/aten::embedding/Gather" type="Gather" version="opset8"> | |
| <data batch_dims="0" /> | |
| <input> | |
| <port id="0" precision="FP32"> | |
| <dim>50282</dim> | |
| <dim>4096</dim> | |
| </port> | |
| <port id="1" precision="I32"> | |
| <dim>-1</dim> | |
| <dim>-1</dim> | |
| </port> | |
| <port id="2" precision="I32" /> | |
| </input> | |
| <output> | |
| <port id="3" precision="FP32"> | |
| <dim>-1</dim> | |
| <dim>-1</dim> | |
| <dim>4096</dim> | |
| </port> | |
| </output> | |
| </layer> | |
| <layer id="6" name="Result_82035" type="Result" version="opset1"> | |
| <input> | |
| <port id="0" precision="FP32"> | |
| <dim>-1</dim> | |
| <dim>-1</dim> | |
| <dim>4096</dim> | |
| </port> | |
| </input> | |
| </layer> | |
| </layers> | |
| <edges> | |
| <edge from-layer="0" from-port="0" to-layer="3" to-port="0" /> | |
| <edge from-layer="1" from-port="0" to-layer="2" to-port="0" /> | |
| <edge from-layer="2" from-port="1" to-layer="5" to-port="0" /> | |
| <edge from-layer="3" from-port="1" to-layer="5" to-port="1" /> | |
| <edge from-layer="4" from-port="0" to-layer="5" to-port="2" /> | |
| <edge from-layer="5" from-port="3" to-layer="6" to-port="0" /> | |
| </edges> | |
| <rt_info> | |
| <Runtime_version value="2023.3.0-13775-ceeafaf64f3-releases/2023/3" /> | |
| <conversion_parameters> | |
| <framework value="pytorch" /> | |
| <is_python_object value="True" /> | |
| </conversion_parameters> | |
| </rt_info> | |
| </net> | |