Image-Text-to-Text
Transformers
Safetensors
qwen3_5
techwithsergiu
conversational
4-bit precision
bitsandbytes
Instructions to use techwithsergiu/Qwen3.5-2B-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use techwithsergiu/Qwen3.5-2B-bnb-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="techwithsergiu/Qwen3.5-2B-bnb-4bit") 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("techwithsergiu/Qwen3.5-2B-bnb-4bit") model = AutoModelForMultimodalLM.from_pretrained("techwithsergiu/Qwen3.5-2B-bnb-4bit") 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 = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use techwithsergiu/Qwen3.5-2B-bnb-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "techwithsergiu/Qwen3.5-2B-bnb-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "techwithsergiu/Qwen3.5-2B-bnb-4bit", "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/techwithsergiu/Qwen3.5-2B-bnb-4bit
- SGLang
How to use techwithsergiu/Qwen3.5-2B-bnb-4bit 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 "techwithsergiu/Qwen3.5-2B-bnb-4bit" \ --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": "techwithsergiu/Qwen3.5-2B-bnb-4bit", "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 "techwithsergiu/Qwen3.5-2B-bnb-4bit" \ --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": "techwithsergiu/Qwen3.5-2B-bnb-4bit", "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 techwithsergiu/Qwen3.5-2B-bnb-4bit with Docker Model Runner:
docker model run hf.co/techwithsergiu/Qwen3.5-2B-bnb-4bit
add Pipeline diagram into readme
Browse files- .gitattributes +1 -0
- README.md +4 -0
- diagrams/diagram_02.png +3 -0
.gitattributes
CHANGED
|
@@ -34,3 +34,4 @@ saved_model/**/* 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 |
tokenizer.json 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 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
diagrams/diagram_02.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -49,6 +49,10 @@ for a larger fraction of the total in smaller models (0.8B) than in larger ones
|
|
| 49 |
For VLM (image + text) fine-tuning with Unsloth, refer to the official guide:
|
| 50 |
[unsloth.ai/docs/models/qwen3.5/fine-tune](https://unsloth.ai/docs/models/qwen3.5/fine-tune)
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
## Acknowledgements
|
| 53 |
|
| 54 |
Based on [Qwen/Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B)
|
|
|
|
| 49 |
For VLM (image + text) fine-tuning with Unsloth, refer to the official guide:
|
| 50 |
[unsloth.ai/docs/models/qwen3.5/fine-tune](https://unsloth.ai/docs/models/qwen3.5/fine-tune)
|
| 51 |
|
| 52 |
+
## Pipeline diagram
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
|
| 56 |
## Acknowledgements
|
| 57 |
|
| 58 |
Based on [Qwen/Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B)
|
diagrams/diagram_02.png
ADDED
|
Git LFS Details
|