Instructions to use HoshiuZ/InternVL3-8B-Unlearned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HoshiuZ/InternVL3-8B-Unlearned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="HoshiuZ/InternVL3-8B-Unlearned", 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("HoshiuZ/InternVL3-8B-Unlearned", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HoshiuZ/InternVL3-8B-Unlearned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HoshiuZ/InternVL3-8B-Unlearned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HoshiuZ/InternVL3-8B-Unlearned", "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/HoshiuZ/InternVL3-8B-Unlearned
- SGLang
How to use HoshiuZ/InternVL3-8B-Unlearned 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 "HoshiuZ/InternVL3-8B-Unlearned" \ --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": "HoshiuZ/InternVL3-8B-Unlearned", "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 "HoshiuZ/InternVL3-8B-Unlearned" \ --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": "HoshiuZ/InternVL3-8B-Unlearned", "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 HoshiuZ/InternVL3-8B-Unlearned with Docker Model Runner:
docker model run hf.co/HoshiuZ/InternVL3-8B-Unlearned
InternVL3-8B — sparse unlearned checkpoint
A full multimodal checkpoint reconstructed from the exact base revision and the identified sparse weight update. The model retains the source wrapper and vision components.
Evaluation scope
Evaluation used text-only input on the frozen 3,668-item WMDP C set. This does not evaluate image or broader multimodal safety. The reported C result is from the frozen scoring run; this exported HF checkpoint was separately compared against the same edited full wrapper on CPU, tensor by tensor.
For base accuracy A0 = base_correct / n and edited accuracy Au = edited_correct / n, the project reports C = (A0 - Au) / (A0 - 0.25). The exact result is shown as a reduced fraction as well as a percentage.
| WMDP C items | Base correct | Edited correct | Exact C | C |
|---|---|---|---|---|
| 3668 | 2173 | 1211 | 481/628 | 76.5924% |
The separate text-only S evaluation is complete: raw S 96.321895%; capped S 96.321895%. See the text S results at the frozen project commit. This does not evaluate image or broader multimodal safety.
Source and edit
- Full multimodal base:
OpenGVLab/InternVL3-8B - Frozen base revision:
853e3a797a661694b1b8ece0cb72dc2b23e3dac9 - Wrapper class:
InternVLChatModel - Sparse update SHA-256:
1cb064d13f6370babc154197480a06705c38ebaf26a3baae8a89850419e287e8(678,955,986 bytes) - Changed weights: language-model MLP
down_projmatrices in layers 4, 5, 6, 7, 9.
This is a sparse GROM-family edit. The frozen update file contains the listed matrices; the contribution of a separately recorded NPO pipeline step is not established by the final overlay, so no NPO-specific effect is claimed.
Loading
Use the complete model through Transformers; no training code or overlay application is needed at load time.
import torch
from transformers import AutoModel, AutoTokenizer
repo = "HoshiuZ/InternVL3-8B-Unlearned"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True, use_fast=False)
model = AutoModel.from_pretrained(
repo, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True
)
License and attribution
The source checkpoint carries the Apache-2.0 model license metadata. The upstream InternVL project states that its project/code is under MIT and that the Qwen2.5 component is under Apache-2.0; see LICENSES.md, the source model card, and OpenGVLab/InternVL. The pinned remote model code is retained from the stated source revision.
Source code
Research and implementation source: HoshiuZ/multimodal-llm-safety.
- Downloads last month
- 17
Model tree for HoshiuZ/InternVL3-8B-Unlearned
Base model
OpenGVLab/InternVL3-8B-Pretrained