Instructions to use second-state/Qwen2-VL-2B-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use second-state/Qwen2-VL-2B-Instruct-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="second-state/Qwen2-VL-2B-Instruct-GGUF") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("second-state/Qwen2-VL-2B-Instruct-GGUF") model = AutoModelForMultimodalLM.from_pretrained("second-state/Qwen2-VL-2B-Instruct-GGUF") - llama-cpp-python
How to use second-state/Qwen2-VL-2B-Instruct-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="second-state/Qwen2-VL-2B-Instruct-GGUF", filename="Qwen2-VL-2B-Instruct-Q2_K.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use second-state/Qwen2-VL-2B-Instruct-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use second-state/Qwen2-VL-2B-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "second-state/Qwen2-VL-2B-Instruct-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "second-state/Qwen2-VL-2B-Instruct-GGUF", "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/second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M
- SGLang
How to use second-state/Qwen2-VL-2B-Instruct-GGUF 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 "second-state/Qwen2-VL-2B-Instruct-GGUF" \ --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": "second-state/Qwen2-VL-2B-Instruct-GGUF", "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 "second-state/Qwen2-VL-2B-Instruct-GGUF" \ --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": "second-state/Qwen2-VL-2B-Instruct-GGUF", "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" } } ] } ] }' - Ollama
How to use second-state/Qwen2-VL-2B-Instruct-GGUF with Ollama:
ollama run hf.co/second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M
- Unsloth Studio
How to use second-state/Qwen2-VL-2B-Instruct-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for second-state/Qwen2-VL-2B-Instruct-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for second-state/Qwen2-VL-2B-Instruct-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for second-state/Qwen2-VL-2B-Instruct-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use second-state/Qwen2-VL-2B-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M
- Lemonade
How to use second-state/Qwen2-VL-2B-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull second-state/Qwen2-VL-2B-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen2-VL-2B-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
Update models
Browse files- .gitattributes +14 -0
- Qwen2-VL-2B-Instruct-Q2_K.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q3_K_L.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q3_K_M.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q3_K_S.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q4_0.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q4_K_M.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q4_K_S.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q5_0.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q5_K_M.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q5_K_S.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q6_K.gguf +3 -0
- Qwen2-VL-2B-Instruct-Q8_0.gguf +3 -0
- Qwen2-VL-2B-Instruct-f16.gguf +3 -0
- Qwen2-VL-2B-Instruct-vision-encoder.gguf +3 -0
- config.json +52 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,17 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Qwen2-VL-2B-Instruct-Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
Qwen2-VL-2B-Instruct-Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
Qwen2-VL-2B-Instruct-Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
Qwen2-VL-2B-Instruct-Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
Qwen2-VL-2B-Instruct-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
Qwen2-VL-2B-Instruct-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
Qwen2-VL-2B-Instruct-Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
Qwen2-VL-2B-Instruct-Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
Qwen2-VL-2B-Instruct-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
Qwen2-VL-2B-Instruct-Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
Qwen2-VL-2B-Instruct-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
Qwen2-VL-2B-Instruct-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
Qwen2-VL-2B-Instruct-f16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
Qwen2-VL-2B-Instruct-vision-encoder.gguf filter=lfs diff=lfs merge=lfs -text
|
Qwen2-VL-2B-Instruct-Q2_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:abe52033da710da3727f8aa1f18414254387dbb76689ccd4d45154e2dafbb3fa
|
| 3 |
+
size 676303328
|
Qwen2-VL-2B-Instruct-Q3_K_L.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:feb289177bcb04bec880720eb7a10890148f8a6586d911b921a301f55d632807
|
| 3 |
+
size 880161248
|
Qwen2-VL-2B-Instruct-Q3_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d95410507ceeb499d7cb912764ce7d505968ecbdfa1e707cebf12a50565b4fb7
|
| 3 |
+
size 824177120
|
Qwen2-VL-2B-Instruct-Q3_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0ea1fa21e51590d13ed794650ebf00be700083c7f699966d415ff482ebc97801
|
| 3 |
+
size 760943072
|
Qwen2-VL-2B-Instruct-Q4_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:478f7d105b903c22325c2d4b85e4aa94d1642106dc6488c5775e4f167c09b6b4
|
| 3 |
+
size 934953440
|
Qwen2-VL-2B-Instruct-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20868587821c6b9f82089daac35918f8150c3568e3c4a2cdd51a24b6dd75ab79
|
| 3 |
+
size 986046944
|
Qwen2-VL-2B-Instruct-Q4_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d87cf355a2e6a802417bc6653edf73e29a7d024e4908231c9c54d6aa5e1460e0
|
| 3 |
+
size 940311008
|
Qwen2-VL-2B-Instruct-Q5_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a384294d51a53b61f75ea9a502ec6ad145c359b9297b1101494db16751dd30d
|
| 3 |
+
size 1098727904
|
Qwen2-VL-2B-Instruct-Q5_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c1364671f4b4f1232082d8a523d2363446f963f3ccb2daa029349254617f79e9
|
| 3 |
+
size 1125048800
|
Qwen2-VL-2B-Instruct-Q5_K_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:50d982a094757fb549a1bde2af6e8925f55d788d34c103bfff4574028527220d
|
| 3 |
+
size 1098727904
|
Qwen2-VL-2B-Instruct-Q6_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7505e951bbeda59f36e0ff413f5a76fec9281f640613e549e0f4398329cf631
|
| 3 |
+
size 1272738272
|
Qwen2-VL-2B-Instruct-Q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c11dff3f74b326668600607a04b412c320d9dfe917a77f48ed6abbd962dd4a44
|
| 3 |
+
size 1646571488
|
Qwen2-VL-2B-Instruct-f16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:56a5c76cbd1ccbc7a0ae9886099761aed1af564427fb9687c26a8dfb4066b74b
|
| 3 |
+
size 3093667808
|
Qwen2-VL-2B-Instruct-vision-encoder.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b5a4e3b50652c60f7a027fb113d7e9d8f9411b0702f4de4e0743f71a3355530
|
| 3 |
+
size 2661115392
|
config.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2VLForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 151643,
|
| 7 |
+
"eos_token_id": 151645,
|
| 8 |
+
"vision_start_token_id": 151652,
|
| 9 |
+
"vision_end_token_id": 151653,
|
| 10 |
+
"vision_token_id": 151654,
|
| 11 |
+
"image_token_id": 151655,
|
| 12 |
+
"video_token_id": 151656,
|
| 13 |
+
"hidden_act": "silu",
|
| 14 |
+
"hidden_size": 1536,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 8960,
|
| 17 |
+
"max_position_embeddings": 32768,
|
| 18 |
+
"max_window_layers": 28,
|
| 19 |
+
"model_type": "qwen2_vl",
|
| 20 |
+
"num_attention_heads": 12,
|
| 21 |
+
"num_hidden_layers": 28,
|
| 22 |
+
"num_key_value_heads": 2,
|
| 23 |
+
"rms_norm_eps": 1e-06,
|
| 24 |
+
"rope_theta": 1000000.0,
|
| 25 |
+
"sliding_window": 32768,
|
| 26 |
+
"tie_word_embeddings": true,
|
| 27 |
+
"torch_dtype": "bfloat16",
|
| 28 |
+
"transformers_version": "4.41.2",
|
| 29 |
+
"use_cache": true,
|
| 30 |
+
"use_sliding_window": false,
|
| 31 |
+
"vision_config": {
|
| 32 |
+
"depth": 32,
|
| 33 |
+
"embed_dim": 1280,
|
| 34 |
+
"mlp_ratio": 4,
|
| 35 |
+
"num_heads": 16,
|
| 36 |
+
"in_chans": 3,
|
| 37 |
+
"hidden_size": 1536,
|
| 38 |
+
"patch_size": 14,
|
| 39 |
+
"spatial_merge_size": 2,
|
| 40 |
+
"spatial_patch_size": 14,
|
| 41 |
+
"temporal_patch_size": 2
|
| 42 |
+
},
|
| 43 |
+
"rope_scaling": {
|
| 44 |
+
"type": "mrope",
|
| 45 |
+
"mrope_section": [
|
| 46 |
+
16,
|
| 47 |
+
24,
|
| 48 |
+
24
|
| 49 |
+
]
|
| 50 |
+
},
|
| 51 |
+
"vocab_size": 151936
|
| 52 |
+
}
|