Image-Text-to-Text
Transformers
Safetensors
English
internvl_chat
feature-extraction
video
multimodal
vision-language
countervid
preference-optimization
dpo
custom_code
conversational
Instructions to use aimagelab/CounterVid-InternVL3-9B-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aimagelab/CounterVid-InternVL3-9B-LoRA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="aimagelab/CounterVid-InternVL3-9B-LoRA", 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("aimagelab/CounterVid-InternVL3-9B-LoRA", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aimagelab/CounterVid-InternVL3-9B-LoRA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aimagelab/CounterVid-InternVL3-9B-LoRA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aimagelab/CounterVid-InternVL3-9B-LoRA", "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/aimagelab/CounterVid-InternVL3-9B-LoRA
- SGLang
How to use aimagelab/CounterVid-InternVL3-9B-LoRA 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 "aimagelab/CounterVid-InternVL3-9B-LoRA" \ --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": "aimagelab/CounterVid-InternVL3-9B-LoRA", "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 "aimagelab/CounterVid-InternVL3-9B-LoRA" \ --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": "aimagelab/CounterVid-InternVL3-9B-LoRA", "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 aimagelab/CounterVid-InternVL3-9B-LoRA with Docker Model Runner:
docker model run hf.co/aimagelab/CounterVid-InternVL3-9B-LoRA
Fix repository references and link training dataset
#2
by tobi1modna - opened
- README.md +3 -1
- release_manifest.json +2 -2
README.md
CHANGED
|
@@ -7,6 +7,8 @@ library_name: transformers
|
|
| 7 |
base_model:
|
| 8 |
- OpenGVLab/InternVL3-9B-Instruct
|
| 9 |
base_model_relation: finetune
|
|
|
|
|
|
|
| 10 |
tags:
|
| 11 |
- video
|
| 12 |
- multimodal
|
|
@@ -44,7 +46,7 @@ For complete video inference and evaluation examples, see the [CounterVid reposi
|
|
| 44 |
## Training summary
|
| 45 |
|
| 46 |
- Base model: [`OpenGVLab/InternVL3-9B-Instruct`](https://huggingface.co/OpenGVLab/InternVL3-9B-Instruct)
|
| 47 |
-
- Training data:
|
| 48 |
- Objective: MixDPO / PaMi-VDPO with CounterVid anchors
|
| 49 |
- LoRA was merged before release; PEFT is not required at inference time
|
| 50 |
- Vision encoder frozen during preference optimization
|
|
|
|
| 7 |
base_model:
|
| 8 |
- OpenGVLab/InternVL3-9B-Instruct
|
| 9 |
base_model_relation: finetune
|
| 10 |
+
datasets:
|
| 11 |
+
- aimagelab/CounterVid
|
| 12 |
tags:
|
| 13 |
- video
|
| 14 |
- multimodal
|
|
|
|
| 46 |
## Training summary
|
| 47 |
|
| 48 |
- Base model: [`OpenGVLab/InternVL3-9B-Instruct`](https://huggingface.co/OpenGVLab/InternVL3-9B-Instruct)
|
| 49 |
+
- Training data: [CounterVid](https://huggingface.co/datasets/aimagelab/CounterVid) (26,167 synthetic visual and textual preference pairs)
|
| 50 |
- Objective: MixDPO / PaMi-VDPO with CounterVid anchors
|
| 51 |
- LoRA was merged before release; PEFT is not required at inference time
|
| 52 |
- Vision encoder frozen during preference optimization
|
release_manifest.json
CHANGED
|
@@ -114,8 +114,8 @@
|
|
| 114 |
"files": [
|
| 115 |
{
|
| 116 |
"name": "README.md",
|
| 117 |
-
"size_bytes":
|
| 118 |
-
"sha256": "
|
| 119 |
},
|
| 120 |
{
|
| 121 |
"name": "added_tokens.json",
|
|
|
|
| 114 |
"files": [
|
| 115 |
{
|
| 116 |
"name": "README.md",
|
| 117 |
+
"size_bytes": 2924,
|
| 118 |
+
"sha256": "3c660164f112be0759301c2018ceaf919c0e374cbffcfb947b0eeb1faaba2f53"
|
| 119 |
},
|
| 120 |
{
|
| 121 |
"name": "added_tokens.json",
|