Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use YahanYu/sft-box_cot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YahanYu/sft-box_cot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="YahanYu/sft-box_cot") 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("YahanYu/sft-box_cot") model = AutoModelForMultimodalLM.from_pretrained("YahanYu/sft-box_cot") 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 YahanYu/sft-box_cot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "YahanYu/sft-box_cot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "YahanYu/sft-box_cot", "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/YahanYu/sft-box_cot
- SGLang
How to use YahanYu/sft-box_cot 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 "YahanYu/sft-box_cot" \ --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": "YahanYu/sft-box_cot", "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 "YahanYu/sft-box_cot" \ --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": "YahanYu/sft-box_cot", "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 YahanYu/sft-box_cot with Docker Model Runner:
docker model run hf.co/YahanYu/sft-box_cot
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 3.0, | |
| "eval_steps": 500, | |
| "global_step": 450, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.06666666666666667, | |
| "grad_norm": 6.6730709205154914, | |
| "learning_rate": 2.0000000000000003e-06, | |
| "loss": 1.0988, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.13333333333333333, | |
| "grad_norm": 5.5250428769267055, | |
| "learning_rate": 4.222222222222223e-06, | |
| "loss": 0.8794, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.2, | |
| "grad_norm": 4.9361543018235885, | |
| "learning_rate": 6.444444444444445e-06, | |
| "loss": 0.7456, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.26666666666666666, | |
| "grad_norm": 4.425363398150815, | |
| "learning_rate": 8.666666666666668e-06, | |
| "loss": 0.7296, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.3333333333333333, | |
| "grad_norm": 5.659123985064816, | |
| "learning_rate": 9.997593339404757e-06, | |
| "loss": 0.7487, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.4, | |
| "grad_norm": 5.05586806638898, | |
| "learning_rate": 9.970545007734807e-06, | |
| "loss": 0.7059, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.4666666666666667, | |
| "grad_norm": 5.289820865349067, | |
| "learning_rate": 9.913603233532067e-06, | |
| "loss": 0.738, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.5333333333333333, | |
| "grad_norm": 6.153731749328359, | |
| "learning_rate": 9.827110471326612e-06, | |
| "loss": 0.7691, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.6, | |
| "grad_norm": 4.72438172347103, | |
| "learning_rate": 9.711586898767462e-06, | |
| "loss": 0.7704, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.6666666666666666, | |
| "grad_norm": 4.953635990533019, | |
| "learning_rate": 9.567727288213005e-06, | |
| "loss": 0.7406, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.7333333333333333, | |
| "grad_norm": 4.34675440311255, | |
| "learning_rate": 9.396396828288272e-06, | |
| "loss": 0.7235, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.8, | |
| "grad_norm": 4.3175589556337, | |
| "learning_rate": 9.19862592053875e-06, | |
| "loss": 0.6883, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.8666666666666667, | |
| "grad_norm": 4.571355090311656, | |
| "learning_rate": 8.97560398247424e-06, | |
| "loss": 0.7847, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.9333333333333333, | |
| "grad_norm": 4.613555810510811, | |
| "learning_rate": 8.728672294272009e-06, | |
| "loss": 0.6963, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "grad_norm": 4.371506300448541, | |
| "learning_rate": 8.45931593215998e-06, | |
| "loss": 0.7373, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 1.0666666666666667, | |
| "grad_norm": 3.7342057510573046, | |
| "learning_rate": 8.16915483699355e-06, | |
| "loss": 0.512, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 1.1333333333333333, | |
| "grad_norm": 4.298642302255544, | |
| "learning_rate": 7.859934071740693e-06, | |
| "loss": 0.4927, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 1.2, | |
| "grad_norm": 3.8809099909137434, | |
| "learning_rate": 7.533513326467911e-06, | |
| "loss": 0.5186, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 1.2666666666666666, | |
| "grad_norm": 4.463525515587306, | |
| "learning_rate": 7.191855733945388e-06, | |
| "loss": 0.4908, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 1.3333333333333333, | |
| "grad_norm": 4.356893382421157, | |
| "learning_rate": 6.837016063135491e-06, | |
| "loss": 0.4654, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 1.4, | |
| "grad_norm": 4.374611713705855, | |
| "learning_rate": 6.4711283615704755e-06, | |
| "loss": 0.4729, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 1.4666666666666668, | |
| "grad_norm": 4.9692452953221, | |
| "learning_rate": 6.0963931209395165e-06, | |
| "loss": 0.5102, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 1.5333333333333332, | |
| "grad_norm": 3.7493297133615213, | |
| "learning_rate": 5.715064043072771e-06, | |
| "loss": 0.4718, | |
| "step": 230 | |
| }, | |
| { | |
| "epoch": 1.6, | |
| "grad_norm": 4.950908705474452, | |
| "learning_rate": 5.329434485913393e-06, | |
| "loss": 0.44, | |
| "step": 240 | |
| }, | |
| { | |
| "epoch": 1.6666666666666665, | |
| "grad_norm": 3.7224976674620107, | |
| "learning_rate": 4.941823670993016e-06, | |
| "loss": 0.4782, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 1.7333333333333334, | |
| "grad_norm": 3.827450682443467, | |
| "learning_rate": 4.5545627353605705e-06, | |
| "loss": 0.4601, | |
| "step": 260 | |
| }, | |
| { | |
| "epoch": 1.8, | |
| "grad_norm": 3.685024204609153, | |
| "learning_rate": 4.1699807118497815e-06, | |
| "loss": 0.487, | |
| "step": 270 | |
| }, | |
| { | |
| "epoch": 1.8666666666666667, | |
| "grad_norm": 4.181381618495043, | |
| "learning_rate": 3.790390522001662e-06, | |
| "loss": 0.5098, | |
| "step": 280 | |
| }, | |
| { | |
| "epoch": 1.9333333333333333, | |
| "grad_norm": 3.6942521819382494, | |
| "learning_rate": 3.418075065882217e-06, | |
| "loss": 0.4917, | |
| "step": 290 | |
| }, | |
| { | |
| "epoch": 2.0, | |
| "grad_norm": 3.6452000651403695, | |
| "learning_rate": 3.0552734924528304e-06, | |
| "loss": 0.4296, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 2.066666666666667, | |
| "grad_norm": 3.9352415875942586, | |
| "learning_rate": 2.7041677330649408e-06, | |
| "loss": 0.2569, | |
| "step": 310 | |
| }, | |
| { | |
| "epoch": 2.1333333333333333, | |
| "grad_norm": 3.3002944542107575, | |
| "learning_rate": 2.3668693790681634e-06, | |
| "loss": 0.2292, | |
| "step": 320 | |
| }, | |
| { | |
| "epoch": 2.2, | |
| "grad_norm": 2.921179549001983, | |
| "learning_rate": 2.0454069824514445e-06, | |
| "loss": 0.239, | |
| "step": 330 | |
| }, | |
| { | |
| "epoch": 2.2666666666666666, | |
| "grad_norm": 3.161626281375529, | |
| "learning_rate": 1.7417138558927244e-06, | |
| "loss": 0.2125, | |
| "step": 340 | |
| }, | |
| { | |
| "epoch": 2.3333333333333335, | |
| "grad_norm": 3.4701571527745436, | |
| "learning_rate": 1.4576164455890014e-06, | |
| "loss": 0.2144, | |
| "step": 350 | |
| }, | |
| { | |
| "epoch": 2.4, | |
| "grad_norm": 3.692771949531677, | |
| "learning_rate": 1.1948233467939978e-06, | |
| "loss": 0.2302, | |
| "step": 360 | |
| }, | |
| { | |
| "epoch": 2.466666666666667, | |
| "grad_norm": 3.1691027059861816, | |
| "learning_rate": 9.549150281252633e-07, | |
| "loss": 0.2005, | |
| "step": 370 | |
| }, | |
| { | |
| "epoch": 2.533333333333333, | |
| "grad_norm": 3.315288600224856, | |
| "learning_rate": 7.393343264399439e-07, | |
| "loss": 0.2277, | |
| "step": 380 | |
| }, | |
| { | |
| "epoch": 2.6, | |
| "grad_norm": 2.855228339850161, | |
| "learning_rate": 5.493777694441521e-07, | |
| "loss": 0.194, | |
| "step": 390 | |
| }, | |
| { | |
| "epoch": 2.6666666666666665, | |
| "grad_norm": 4.071561539790418, | |
| "learning_rate": 3.8618777822278854e-07, | |
| "loss": 0.2366, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 2.7333333333333334, | |
| "grad_norm": 3.157323407608041, | |
| "learning_rate": 2.5074579658471266e-07, | |
| "loss": 0.2157, | |
| "step": 410 | |
| }, | |
| { | |
| "epoch": 2.8, | |
| "grad_norm": 3.335773048507566, | |
| "learning_rate": 1.438663885441982e-07, | |
| "loss": 0.2204, | |
| "step": 420 | |
| }, | |
| { | |
| "epoch": 2.8666666666666667, | |
| "grad_norm": 3.7293712025052437, | |
| "learning_rate": 6.61923394371039e-08, | |
| "loss": 0.1931, | |
| "step": 430 | |
| }, | |
| { | |
| "epoch": 2.9333333333333336, | |
| "grad_norm": 3.212509117260097, | |
| "learning_rate": 1.8190790134231528e-08, | |
| "loss": 0.2086, | |
| "step": 440 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "grad_norm": 3.0071297422923546, | |
| "learning_rate": 1.504276011621286e-10, | |
| "loss": 0.2162, | |
| "step": 450 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "step": 450, | |
| "total_flos": 8016607100928.0, | |
| "train_loss": 0.49070788860321046, | |
| "train_runtime": 3037.8812, | |
| "train_samples_per_second": 0.889, | |
| "train_steps_per_second": 0.148 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 450, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 8016607100928.0, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |