Instructions to use FastFlowLM/Qwen3.5-0.8B-NPU2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FastFlowLM/Qwen3.5-0.8B-NPU2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="FastFlowLM/Qwen3.5-0.8B-NPU2") 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 AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("FastFlowLM/Qwen3.5-0.8B-NPU2") model = AutoModelForMultimodalLM.from_pretrained("FastFlowLM/Qwen3.5-0.8B-NPU2", device_map="auto") 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?"} ] }, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FastFlowLM/Qwen3.5-0.8B-NPU2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FastFlowLM/Qwen3.5-0.8B-NPU2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FastFlowLM/Qwen3.5-0.8B-NPU2", "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/FastFlowLM/Qwen3.5-0.8B-NPU2
- SGLang
How to use FastFlowLM/Qwen3.5-0.8B-NPU2 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 "FastFlowLM/Qwen3.5-0.8B-NPU2" \ --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": "FastFlowLM/Qwen3.5-0.8B-NPU2", "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 "FastFlowLM/Qwen3.5-0.8B-NPU2" \ --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": "FastFlowLM/Qwen3.5-0.8B-NPU2", "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 FastFlowLM/Qwen3.5-0.8B-NPU2 with Docker Model Runner:
docker model run hf.co/FastFlowLM/Qwen3.5-0.8B-NPU2
ngdxzy commited on
Commit ·
b478bb4
1
Parent(s): ee71fb6
feat: added vision
Browse files- config.json +26 -1
- vision_weight.q4nx +3 -0
config.json
CHANGED
|
@@ -72,5 +72,30 @@
|
|
| 72 |
},
|
| 73 |
"addr_qk": 53248,
|
| 74 |
"addr_kv": 53536,
|
| 75 |
-
"flm_version": "0.9.21"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
}
|
|
|
|
| 72 |
},
|
| 73 |
"addr_qk": 53248,
|
| 74 |
"addr_kv": 53536,
|
| 75 |
+
"flm_version": "0.9.21",
|
| 76 |
+
"vision_model_weight": "vision_weight.q4nx",
|
| 77 |
+
"vision_config": {
|
| 78 |
+
"vision_mm_engine_xclbin_name": "vision_mm.xclbin",
|
| 79 |
+
"vision_mha_engine_xclbin_name": "vision_attn.xclbin",
|
| 80 |
+
"QWEN3_5_PATCH_SIZE": 16,
|
| 81 |
+
"QWEN3_5_IMAGE_MERGE_SIZE": 2,
|
| 82 |
+
"QWEN3_5_SPATIAL_MERGE_SIZE": 2,
|
| 83 |
+
"QWEN3_5_SHORTEST_EDGE": 65536,
|
| 84 |
+
"QWEN3_5_LONGEST_EDGE": 16777216,
|
| 85 |
+
"QWEN3_5_VISION_RESCALE_FACTOR": 0.00392156862745098,
|
| 86 |
+
"QWEN3_5_VISION_RESCALE_IMAGE_MEAN": 0.5,
|
| 87 |
+
"QWEN3_5_VISION_RESCALE_IMAGE_STD": 0.5,
|
| 88 |
+
"QWEN3_5_TEMPORAL_PATCH_SIZE": 2,
|
| 89 |
+
"QWEN3_5_VISION_EMBED_DIM": 768,
|
| 90 |
+
"QWEN3_5_VISION_NUM_HEADS": 12,
|
| 91 |
+
"QWEN3_5_VISION_HEAD_DIM": 64,
|
| 92 |
+
"QWEN3_5_VISION_MLP_INTERMEDIATE_SIZE": 3072,
|
| 93 |
+
"QWEN3_5_VISION_NUM_POSITION_EMBEDDINGS": 2304,
|
| 94 |
+
"QWEN3_5_VISION_NUM_LAYERS": 12,
|
| 95 |
+
"QWEN3_5_VISION_LAYER_NORM_EPSILON": 1e-06,
|
| 96 |
+
"QWEN3_5_VISION_OUT_HIDDEN_SIZE": 1024,
|
| 97 |
+
"VISION_MM_TILE_M": 128,
|
| 98 |
+
"VISION_MM_TILE_K": 256,
|
| 99 |
+
"VISION_MM_TILE_N": 64
|
| 100 |
+
}
|
| 101 |
}
|
vision_weight.q4nx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:94e6b19043bf1d07645ee1e0a44b44016abb881801027b39656b7f7872f8fc18
|
| 3 |
+
size 201202552
|