Image-Text-to-Text
Transformers
Safetensors
internvl_chat
feature-extraction
fp8
quantization
llm-compressor
vllm
vision
multimodal
conversational
custom_code
compressed-tensors
Instructions to use ucsbcit/InternVL3_5-38B-Flash-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ucsbcit/InternVL3_5-38B-Flash-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ucsbcit/InternVL3_5-38B-Flash-FP8", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ucsbcit/InternVL3_5-38B-Flash-FP8", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ucsbcit/InternVL3_5-38B-Flash-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ucsbcit/InternVL3_5-38B-Flash-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ucsbcit/InternVL3_5-38B-Flash-FP8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/ucsbcit/InternVL3_5-38B-Flash-FP8
- SGLang
How to use ucsbcit/InternVL3_5-38B-Flash-FP8 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 "ucsbcit/InternVL3_5-38B-Flash-FP8" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ucsbcit/InternVL3_5-38B-Flash-FP8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "ucsbcit/InternVL3_5-38B-Flash-FP8" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ucsbcit/InternVL3_5-38B-Flash-FP8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use ucsbcit/InternVL3_5-38B-Flash-FP8 with Docker Model Runner:
docker model run hf.co/ucsbcit/InternVL3_5-38B-Flash-FP8
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
base_model: OpenGVLab/InternVL3_5-38B-Flash
|
| 4 |
+
tags:
|
| 5 |
+
- fp8
|
| 6 |
+
- quantization
|
| 7 |
+
- llm-compressor
|
| 8 |
+
- vllm
|
| 9 |
+
- vision
|
| 10 |
+
- multimodal
|
| 11 |
+
pipeline_tag: image-text-to-text
|
| 12 |
+
library_name: transformers
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# InternVL3_5-38B-Flash-FP8
|
| 16 |
+
|
| 17 |
+
This repository contains an **FP8 quantized version** of the multi-modal model [OpenGVLab/InternVL3_5-38B-Flash](https://huggingface.co/OpenGVLab/InternVL3_5-38B-Flash).
|
| 18 |
+
|
| 19 |
+
## Model Details
|
| 20 |
+
* **Base Model:** `OpenGVLab/InternVL3_5-38B-Flash`
|
| 21 |
+
* **Quantization Format:** FP8 (E4M3) targeting `Linear` layers
|
| 22 |
+
* **Quantization Engine:** `llmcompressor` (Post-Training Quantization / PTQ)
|
| 23 |
+
* **Calibration Dataset:** 512 samples from `ultrachat-200k` (`train_sft`)
|
| 24 |
+
* **License:** MIT
|
| 25 |
+
|
| 26 |
+
## Method & Creation Process
|
| 27 |
+
|
| 28 |
+
The model was quantized using Neural Magic's [`llm-compressor`](https://github.com/vllm-project/llm-compressor) framework.
|
| 29 |
+
|
| 30 |
+
Post-training quantization (PTQ) was applied directly to the language backbone (`model.language_model`). This strategy ensures that all heavy `Linear` projections in the main LLM layers are converted to FP8 for maximum speedup and reduced VRAM footprint, while preserving the vision architecture intact.
|
| 31 |
+
|
| 32 |
+
### Quantization Recipe
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
from llmcompressor import oneshot
|
| 36 |
+
from llmcompressor.modifiers.quantization import QuantizationModifier
|
| 37 |
+
|
| 38 |
+
recipe = QuantizationModifier(
|
| 39 |
+
targets="Linear",
|
| 40 |
+
scheme="FP8",
|
| 41 |
+
ignore=["lm_head"]
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
oneshot(
|
| 45 |
+
model=model.language_model,
|
| 46 |
+
tokenizer=tokenizer,
|
| 47 |
+
dataset="ultrachat-200k",
|
| 48 |
+
splits="train_sft[:512]",
|
| 49 |
+
recipe=recipe,
|
| 50 |
+
max_seq_length=2048,
|
| 51 |
+
num_calibration_samples=512,
|
| 52 |
+
)
|