Instructions to use oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA") 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("oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA") model = AutoModelForMultimodalLM.from_pretrained("oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA") 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 oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA", "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/oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA
- SGLang
How to use oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA 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 "oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA" \ --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": "oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA", "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 "oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA" \ --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": "oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA", "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 oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA with Docker Model Runner:
docker model run hf.co/oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA
Qwen3-VL-4B-Instruct-Flowers102-Open-QA
This model is a fine-tuned version of Qwen/Qwen3-VL-4B-Instruct on a custom dataset.
Model Details
- Base Model: Qwen/Qwen3-VL-4B-Instruct
- Fine-tuned from checkpoint: 2500
- Model Type: Vision-Language Model
- Training Framework: LMMS-Engine with FSDP2
Training Details
Training Data
Custom dataset based on Oxford Flowers102 found here.
Training Hyperparameters
- Per Device Train Batch Size: 1
- Learning Rate: 2e-05
- Weight Decay: 0.0
- Gradient Accumulation Steps: 8
- Gradient Checkpointing: True
- Warmup Ratio: 0.1
- Max Steps: 5000
- Number of Epochs: 1
- LR Scheduler: cosine
- Optimizer: adamw_torch_fused
- Mixed Precision (BF16): True
- FSDP2: True
- Save Steps: 500
- Logging Steps: 1
Training Configuration
- Checkpoint Step: 2500
- Training Framework: LMMS-Engine
- Distributed Training: FSDP2 (Fully Sharded Data Parallel v2)
Usage
from transformers import AutoProcessor, AutoModel
import torch
# Load model and processor
processor = AutoProcessor.from_pretrained("oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA")
model = AutoModel.from_pretrained("oscarqjh/Qwen3-VL-4B-Instruct-Flowers102-Open-QA", torch_dtype=torch.bfloat16)
# Example usage
# Your inference code here
Training Framework
This model was trained using LMMS-Engine, a framework for training large multimodal models.
Limitations and Bias
This model inherits the limitations and potential biases from its base model Qwen/Qwen3-VL-4B-Instruct. Please refer to the base model's documentation for detailed information about limitations and ethical considerations.
Citation
If you use this model, please cite the original base model and the training framework used.
- Downloads last month
- 1