Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start") model = AutoModelForImageTextToText.from_pretrained("LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start") 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
- vLLM
How to use LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start", "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/LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start
- SGLang
How to use LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start 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 "LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start" \ --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": "LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start", "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 "LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start" \ --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": "LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start", "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 LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start with Docker Model Runner:
docker model run hf.co/LMMs-Lab-Turtle/Qwen-2.5VL-3B-Cold-Start
| {"current_steps": 10, "total_steps": 177, "loss": 0.8834, "lr": 5.555555555555557e-06, "epoch": 0.16806722689075632, "percentage": 5.65, "elapsed_time": "0:01:07", "remaining_time": "0:18:45"} | |
| {"current_steps": 20, "total_steps": 177, "loss": 0.832, "lr": 9.99609654676786e-06, "epoch": 0.33613445378151263, "percentage": 11.3, "elapsed_time": "0:02:15", "remaining_time": "0:17:41"} | |
| {"current_steps": 30, "total_steps": 177, "loss": 0.7929, "lr": 9.860114570402055e-06, "epoch": 0.5042016806722689, "percentage": 16.95, "elapsed_time": "0:03:19", "remaining_time": "0:16:19"} | |
| {"current_steps": 40, "total_steps": 177, "loss": 0.7613, "lr": 9.535012074008688e-06, "epoch": 0.6722689075630253, "percentage": 22.6, "elapsed_time": "0:04:18", "remaining_time": "0:14:46"} | |
| {"current_steps": 50, "total_steps": 177, "loss": 0.7369, "lr": 9.033439696227966e-06, "epoch": 0.8403361344537815, "percentage": 28.25, "elapsed_time": "0:05:20", "remaining_time": "0:13:33"} | |
| {"current_steps": 60, "total_steps": 177, "loss": 0.6853, "lr": 8.374915007591053e-06, "epoch": 1.0, "percentage": 33.9, "elapsed_time": "0:06:18", "remaining_time": "0:12:17"} | |
| {"current_steps": 70, "total_steps": 177, "loss": 0.6288, "lr": 7.58506302778873e-06, "epoch": 1.1680672268907564, "percentage": 39.55, "elapsed_time": "0:07:23", "remaining_time": "0:11:17"} | |
| {"current_steps": 80, "total_steps": 177, "loss": 0.5971, "lr": 6.694619085176159e-06, "epoch": 1.3361344537815127, "percentage": 45.2, "elapsed_time": "0:08:21", "remaining_time": "0:10:07"} | |
| {"current_steps": 90, "total_steps": 177, "loss": 0.5633, "lr": 5.738232820012407e-06, "epoch": 1.504201680672269, "percentage": 50.85, "elapsed_time": "0:09:27", "remaining_time": "0:09:08"} | |
| {"current_steps": 100, "total_steps": 177, "loss": 0.5586, "lr": 4.753119870981486e-06, "epoch": 1.6722689075630253, "percentage": 56.5, "elapsed_time": "0:10:28", "remaining_time": "0:08:04"} | |
| {"current_steps": 110, "total_steps": 177, "loss": 0.5633, "lr": 3.777613711607087e-06, "epoch": 1.8403361344537816, "percentage": 62.15, "elapsed_time": "0:11:30", "remaining_time": "0:07:00"} | |
| {"current_steps": 120, "total_steps": 177, "loss": 0.5249, "lr": 2.8496739886173994e-06, "epoch": 2.0, "percentage": 67.8, "elapsed_time": "0:12:30", "remaining_time": "0:05:56"} | |
| {"current_steps": 130, "total_steps": 177, "loss": 0.4774, "lr": 2.005409406946e-06, "epoch": 2.168067226890756, "percentage": 73.45, "elapsed_time": "0:13:35", "remaining_time": "0:04:54"} | |
| {"current_steps": 140, "total_steps": 177, "loss": 0.4569, "lr": 1.277672640004936e-06, "epoch": 2.3361344537815127, "percentage": 79.1, "elapsed_time": "0:14:38", "remaining_time": "0:03:52"} | |
| {"current_steps": 150, "total_steps": 177, "loss": 0.4598, "lr": 6.947819411632223e-07, "epoch": 2.504201680672269, "percentage": 84.75, "elapsed_time": "0:15:41", "remaining_time": "0:02:49"} | |
| {"current_steps": 160, "total_steps": 177, "loss": 0.4533, "lr": 2.7941920206915443e-07, "epoch": 2.6722689075630255, "percentage": 90.4, "elapsed_time": "0:16:44", "remaining_time": "0:01:46"} | |
| {"current_steps": 170, "total_steps": 177, "loss": 0.4608, "lr": 4.774733741942206e-08, "epoch": 2.8403361344537816, "percentage": 96.05, "elapsed_time": "0:17:48", "remaining_time": "0:00:43"} | |
| {"current_steps": 177, "total_steps": 177, "epoch": 2.957983193277311, "percentage": 100.0, "elapsed_time": "0:18:55", "remaining_time": "0:00:00"} | |