Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

5CD-AI
/
Vintern-1B-v2

Image-Text-to-Text
Transformers
Safetensors
Vietnamese
English
internvl_chat
feature-extraction
vision
conversational
custom_code
Model card Files Files and versions
xet
Community
13

Instructions to use 5CD-AI/Vintern-1B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use 5CD-AI/Vintern-1B-v2 with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("image-text-to-text", model="5CD-AI/Vintern-1B-v2", 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("5CD-AI/Vintern-1B-v2", trust_remote_code=True, dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use 5CD-AI/Vintern-1B-v2 with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "5CD-AI/Vintern-1B-v2"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "5CD-AI/Vintern-1B-v2",
    		"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/5CD-AI/Vintern-1B-v2
  • SGLang

    How to use 5CD-AI/Vintern-1B-v2 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 "5CD-AI/Vintern-1B-v2" \
        --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": "5CD-AI/Vintern-1B-v2",
    		"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 "5CD-AI/Vintern-1B-v2" \
            --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": "5CD-AI/Vintern-1B-v2",
    		"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 5CD-AI/Vintern-1B-v2 with Docker Model Runner:

    docker model run hf.co/5CD-AI/Vintern-1B-v2
New discussion
Resources
  • PR & discussions documentation
  • Code of Conduct
  • Hub documentation

How can I finetune on my customized datasets?

#13 opened 9 months ago by
bimcaucau

Deploy model on cpu ?

#12 opened about 1 year ago by
duydc2k1

Issue Encountered While Running Sample Fine-tuning Code

1
#10 opened over 1 year ago by
dauvannam321

How to run on Mac or without cuda?

🚀 1
1
#8 opened over 1 year ago by
namht94

TypeErorr: got multiple values for keyword argument 'return_dict'

4
#7 opened over 1 year ago by
pdaq11

Error while fine-tuning

#6 opened over 1 year ago by
polieste

Model OCR not good result with day month year

🔥 1
4
#4 opened over 1 year ago by
thanhtan2136

About fine-tune recipe

2
#3 opened over 1 year ago by
ginvu

Nice model, thanks for sharing

🤗 1
3
#2 opened over 1 year ago by
tiendung

About gradio demo

🤗 1
2
#1 opened over 1 year ago by
ginvu
Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs