Image-Text-to-Text
Transformers
Safetensors
qwen3_5
llama-factory
full
Generated from Trainer
conversational
Instructions to use XiXiHaHaZhao/STAGE2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XiXiHaHaZhao/STAGE2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="XiXiHaHaZhao/STAGE2") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("XiXiHaHaZhao/STAGE2") model = AutoModelForMultimodalLM.from_pretrained("XiXiHaHaZhao/STAGE2", 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 = 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XiXiHaHaZhao/STAGE2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XiXiHaHaZhao/STAGE2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XiXiHaHaZhao/STAGE2", "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/XiXiHaHaZhao/STAGE2
- SGLang
How to use XiXiHaHaZhao/STAGE2 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 "XiXiHaHaZhao/STAGE2" \ --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": "XiXiHaHaZhao/STAGE2", "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 "XiXiHaHaZhao/STAGE2" \ --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": "XiXiHaHaZhao/STAGE2", "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 XiXiHaHaZhao/STAGE2 with Docker Model Runner:
docker model run hf.co/XiXiHaHaZhao/STAGE2
Download trainer_log.jsonl from XiXiHaHaZhao/STAGE2: direct link, hf CLI and curl.
- Browser
- Download file 4.02 kB
-
https://huggingface.co/XiXiHaHaZhao/STAGE2/resolve/main/trainer_log.jsonl
- Command line
-
hf download hf://XiXiHaHaZhao/STAGE2/trainer_log.jsonl
-
curl -L -o trainer_log.jsonl https://huggingface.co/XiXiHaHaZhao/STAGE2/resolve/main/trainer_log.jsonl
4.02 kB
| {"current_steps": 10, "total_steps": 192, "loss": 0.408135986328125, "lr": 4.5e-06, "epoch": 0.1568627450980392, "percentage": 5.21, "elapsed_time": "0:01:53", "remaining_time": "0:34:30"} | |
| {"current_steps": 20, "total_steps": 192, "loss": 0.23105964660644532, "lr": 9.5e-06, "epoch": 0.3137254901960784, "percentage": 10.42, "elapsed_time": "0:03:44", "remaining_time": "0:32:06"} | |
| {"current_steps": 30, "total_steps": 192, "loss": 0.18245965242385864, "lr": 9.932595378142233e-06, "epoch": 0.47058823529411764, "percentage": 15.62, "elapsed_time": "0:05:27", "remaining_time": "0:29:30"} | |
| {"current_steps": 40, "total_steps": 192, "loss": 0.1605141878128052, "lr": 9.701923994199784e-06, "epoch": 0.6274509803921569, "percentage": 20.83, "elapsed_time": "0:07:15", "remaining_time": "0:27:34"} | |
| {"current_steps": 50, "total_steps": 192, "loss": 0.158633816242218, "lr": 9.314825963771724e-06, "epoch": 0.7843137254901961, "percentage": 26.04, "elapsed_time": "0:08:58", "remaining_time": "0:25:30"} | |
| {"current_steps": 60, "total_steps": 192, "loss": 0.15139737129211425, "lr": 8.784179514331683e-06, "epoch": 0.9411764705882353, "percentage": 31.25, "elapsed_time": "0:10:42", "remaining_time": "0:23:34"} | |
| {"current_steps": 70, "total_steps": 192, "loss": 0.1387779712677002, "lr": 8.127638534938227e-06, "epoch": 1.0941176470588236, "percentage": 36.46, "elapsed_time": "0:12:28", "remaining_time": "0:21:44"} | |
| {"current_steps": 80, "total_steps": 192, "loss": 0.12184641361236573, "lr": 7.367045255243217e-06, "epoch": 1.2509803921568627, "percentage": 41.67, "elapsed_time": "0:14:12", "remaining_time": "0:19:53"} | |
| {"current_steps": 90, "total_steps": 192, "loss": 0.11027407646179199, "lr": 6.527703584078219e-06, "epoch": 1.4078431372549018, "percentage": 46.88, "elapsed_time": "0:16:04", "remaining_time": "0:18:13"} | |
| {"current_steps": 100, "total_steps": 192, "loss": 0.11028397083282471, "lr": 5.63753728266054e-06, "epoch": 1.5647058823529412, "percentage": 52.08, "elapsed_time": "0:17:49", "remaining_time": "0:16:23"} | |
| {"current_steps": 110, "total_steps": 192, "loss": 0.10918575525283813, "lr": 4.726160978856782e-06, "epoch": 1.7215686274509805, "percentage": 57.29, "elapsed_time": "0:19:33", "remaining_time": "0:14:34"} | |
| {"current_steps": 120, "total_steps": 192, "loss": 0.0961656391620636, "lr": 3.823894928601822e-06, "epoch": 1.8784313725490196, "percentage": 62.5, "elapsed_time": "0:21:17", "remaining_time": "0:12:46"} | |
| {"current_steps": 130, "total_steps": 192, "loss": 0.08220374584197998, "lr": 2.9607563020271446e-06, "epoch": 2.0313725490196077, "percentage": 67.71, "elapsed_time": "0:23:10", "remaining_time": "0:11:03"} | |
| {"current_steps": 140, "total_steps": 192, "loss": 0.05620207190513611, "lr": 2.1654605528435774e-06, "epoch": 2.1882352941176473, "percentage": 72.92, "elapsed_time": "0:25:03", "remaining_time": "0:09:18"} | |
| {"current_steps": 150, "total_steps": 192, "loss": 0.06362113952636719, "lr": 1.4644660940672628e-06, "epoch": 2.3450980392156864, "percentage": 78.12, "elapsed_time": "0:26:48", "remaining_time": "0:07:30"} | |
| {"current_steps": 160, "total_steps": 192, "loss": 0.063688462972641, "lr": 8.810940624342784e-07, "epoch": 2.5019607843137255, "percentage": 83.33, "elapsed_time": "0:28:37", "remaining_time": "0:05:43"} | |
| {"current_steps": 170, "total_steps": 192, "loss": 0.05568122863769531, "lr": 4.347524557502919e-07, "epoch": 2.6588235294117646, "percentage": 88.54, "elapsed_time": "0:30:21", "remaining_time": "0:03:55"} | |
| {"current_steps": 180, "total_steps": 192, "loss": 0.05975309610366821, "lr": 1.4029045507537696e-07, "epoch": 2.8156862745098037, "percentage": 93.75, "elapsed_time": "0:32:05", "remaining_time": "0:02:08"} | |
| {"current_steps": 190, "total_steps": 192, "loss": 0.052491509914398195, "lr": 7.5044125708712e-09, "epoch": 2.9725490196078432, "percentage": 98.96, "elapsed_time": "0:33:50", "remaining_time": "0:00:21"} | |
| {"current_steps": 192, "total_steps": 192, "epoch": 3.0, "percentage": 100.0, "elapsed_time": "0:34:19", "remaining_time": "0:00:00"} | |