Image-Text-to-Text
Transformers
Safetensors
internvl_chat
feature-extraction
unlearning
wmdp
multimodal
conversational
custom_code
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
|
Download README.md from HoshiuZ/InternVL3-8B-Unlearned: direct link, hf CLI and curl.
- Browser
- Download file 3.09 kB
-
https://huggingface.co/HoshiuZ/InternVL3-8B-Unlearned/resolve/main/README.md
- Command line
-
hf download hf://HoshiuZ/InternVL3-8B-Unlearned/README.md
-
curl -L -o README.md https://huggingface.co/HoshiuZ/InternVL3-8B-Unlearned/resolve/main/README.md
3.09 kB
| license: apache-2.0 | |
| base_model: OpenGVLab/InternVL3-8B | |
| pipeline_tag: image-text-to-text | |
| library_name: transformers | |
| tags: | |
| - unlearning | |
| - wmdp | |
| - multimodal | |
| - safetensors | |
| # 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](https://github.com/HoshiuZ/multimodal-llm-safety/blob/dd6e4f5117aafecaa8747416f3826faaeaae9bb8/text/results/s_results_v2.json). This does not evaluate image or broader multimodal safety. | |
| ## Source and edit | |
| - Full multimodal base: [`OpenGVLab/InternVL3-8B`](https://huggingface.co/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_proj` matrices 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. | |
| ```python | |
| 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`](LICENSES.md), the [source model card](https://huggingface.co/OpenGVLab/InternVL3-8B), and [OpenGVLab/InternVL](https://github.com/OpenGVLab/InternVL). The pinned remote model code is retained from the stated source revision. | |
| ## Source code | |
| Research and implementation source: [HoshiuZ/multimodal-llm-safety](https://github.com/HoshiuZ/multimodal-llm-safety). | |