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_only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YahanYu/sft-box_only with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="YahanYu/sft-box_only") 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_only") model = AutoModelForMultimodalLM.from_pretrained("YahanYu/sft-box_only") 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_only with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "YahanYu/sft-box_only" # 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_only", "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_only
- SGLang
How to use YahanYu/sft-box_only 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_only" \ --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_only", "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_only" \ --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_only", "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_only with Docker Model Runner:
docker model run hf.co/YahanYu/sft-box_only
| { | |
| "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": 22.209487386412402, | |
| "learning_rate": 2.0000000000000003e-06, | |
| "loss": 1.6796, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.13333333333333333, | |
| "grad_norm": 12.935591671884186, | |
| "learning_rate": 4.222222222222223e-06, | |
| "loss": 0.9302, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.2, | |
| "grad_norm": 10.319883299987719, | |
| "learning_rate": 6.444444444444445e-06, | |
| "loss": 0.7924, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.26666666666666666, | |
| "grad_norm": 12.315119624210944, | |
| "learning_rate": 8.666666666666668e-06, | |
| "loss": 0.6202, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.3333333333333333, | |
| "grad_norm": 11.463518477145703, | |
| "learning_rate": 9.997593339404757e-06, | |
| "loss": 0.7137, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.4, | |
| "grad_norm": 10.780290504564283, | |
| "learning_rate": 9.970545007734807e-06, | |
| "loss": 0.6711, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.4666666666666667, | |
| "grad_norm": 6.943408420106348, | |
| "learning_rate": 9.913603233532067e-06, | |
| "loss": 0.6028, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.5333333333333333, | |
| "grad_norm": 7.284073674940058, | |
| "learning_rate": 9.827110471326612e-06, | |
| "loss": 0.6037, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.6, | |
| "grad_norm": 6.807732765497465, | |
| "learning_rate": 9.711586898767462e-06, | |
| "loss": 0.5778, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.6666666666666666, | |
| "grad_norm": 11.83732337075223, | |
| "learning_rate": 9.567727288213005e-06, | |
| "loss": 0.5805, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.7333333333333333, | |
| "grad_norm": 5.14349896200111, | |
| "learning_rate": 9.396396828288272e-06, | |
| "loss": 0.5779, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.8, | |
| "grad_norm": 4.661943441211666, | |
| "learning_rate": 9.19862592053875e-06, | |
| "loss": 0.5815, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.8666666666666667, | |
| "grad_norm": 7.550644416232132, | |
| "learning_rate": 8.97560398247424e-06, | |
| "loss": 0.5525, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.9333333333333333, | |
| "grad_norm": 7.1943467432123285, | |
| "learning_rate": 8.728672294272009e-06, | |
| "loss": 0.5502, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "grad_norm": 5.4209158963202695, | |
| "learning_rate": 8.45931593215998e-06, | |
| "loss": 0.6258, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 1.0666666666666667, | |
| "grad_norm": 2.7234457746218106, | |
| "learning_rate": 8.16915483699355e-06, | |
| "loss": 0.5362, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 1.1333333333333333, | |
| "grad_norm": 5.20579567040701, | |
| "learning_rate": 7.859934071740693e-06, | |
| "loss": 0.5256, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 1.2, | |
| "grad_norm": 5.542411741472658, | |
| "learning_rate": 7.533513326467911e-06, | |
| "loss": 0.5071, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 1.2666666666666666, | |
| "grad_norm": 5.066455668318536, | |
| "learning_rate": 7.191855733945388e-06, | |
| "loss": 0.5, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 1.3333333333333333, | |
| "grad_norm": 7.261519258384245, | |
| "learning_rate": 6.837016063135491e-06, | |
| "loss": 0.4927, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 1.4, | |
| "grad_norm": 6.379167040037112, | |
| "learning_rate": 6.4711283615704755e-06, | |
| "loss": 0.4771, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 1.4666666666666668, | |
| "grad_norm": 4.961887194084468, | |
| "learning_rate": 6.0963931209395165e-06, | |
| "loss": 0.4931, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 1.5333333333333332, | |
| "grad_norm": 4.828923581269833, | |
| "learning_rate": 5.715064043072771e-06, | |
| "loss": 0.4538, | |
| "step": 230 | |
| }, | |
| { | |
| "epoch": 1.6, | |
| "grad_norm": 7.065358575784043, | |
| "learning_rate": 5.329434485913393e-06, | |
| "loss": 0.5141, | |
| "step": 240 | |
| }, | |
| { | |
| "epoch": 1.6666666666666665, | |
| "grad_norm": 5.858179436757541, | |
| "learning_rate": 4.941823670993016e-06, | |
| "loss": 0.4738, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 1.7333333333333334, | |
| "grad_norm": 3.3970862511359323, | |
| "learning_rate": 4.5545627353605705e-06, | |
| "loss": 0.4562, | |
| "step": 260 | |
| }, | |
| { | |
| "epoch": 1.8, | |
| "grad_norm": 4.767196253501312, | |
| "learning_rate": 4.1699807118497815e-06, | |
| "loss": 0.4668, | |
| "step": 270 | |
| }, | |
| { | |
| "epoch": 1.8666666666666667, | |
| "grad_norm": 6.756725811503202, | |
| "learning_rate": 3.790390522001662e-06, | |
| "loss": 0.5062, | |
| "step": 280 | |
| }, | |
| { | |
| "epoch": 1.9333333333333333, | |
| "grad_norm": 4.291284665043423, | |
| "learning_rate": 3.418075065882217e-06, | |
| "loss": 0.4358, | |
| "step": 290 | |
| }, | |
| { | |
| "epoch": 2.0, | |
| "grad_norm": 5.089066811967618, | |
| "learning_rate": 3.0552734924528304e-06, | |
| "loss": 0.4874, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 2.066666666666667, | |
| "grad_norm": 4.724155427886196, | |
| "learning_rate": 2.7041677330649408e-06, | |
| "loss": 0.3615, | |
| "step": 310 | |
| }, | |
| { | |
| "epoch": 2.1333333333333333, | |
| "grad_norm": 4.949909188287264, | |
| "learning_rate": 2.3668693790681634e-06, | |
| "loss": 0.3414, | |
| "step": 320 | |
| }, | |
| { | |
| "epoch": 2.2, | |
| "grad_norm": 4.331817106456939, | |
| "learning_rate": 2.0454069824514445e-06, | |
| "loss": 0.3424, | |
| "step": 330 | |
| }, | |
| { | |
| "epoch": 2.2666666666666666, | |
| "grad_norm": 3.6287237509360906, | |
| "learning_rate": 1.7417138558927244e-06, | |
| "loss": 0.3071, | |
| "step": 340 | |
| }, | |
| { | |
| "epoch": 2.3333333333333335, | |
| "grad_norm": 6.218473716023565, | |
| "learning_rate": 1.4576164455890014e-06, | |
| "loss": 0.3227, | |
| "step": 350 | |
| }, | |
| { | |
| "epoch": 2.4, | |
| "grad_norm": 4.915592321889467, | |
| "learning_rate": 1.1948233467939978e-06, | |
| "loss": 0.3178, | |
| "step": 360 | |
| }, | |
| { | |
| "epoch": 2.466666666666667, | |
| "grad_norm": 3.66628775989013, | |
| "learning_rate": 9.549150281252633e-07, | |
| "loss": 0.314, | |
| "step": 370 | |
| }, | |
| { | |
| "epoch": 2.533333333333333, | |
| "grad_norm": 5.284825727103242, | |
| "learning_rate": 7.393343264399439e-07, | |
| "loss": 0.3084, | |
| "step": 380 | |
| }, | |
| { | |
| "epoch": 2.6, | |
| "grad_norm": 4.423778708955016, | |
| "learning_rate": 5.493777694441521e-07, | |
| "loss": 0.3215, | |
| "step": 390 | |
| }, | |
| { | |
| "epoch": 2.6666666666666665, | |
| "grad_norm": 4.353121575589735, | |
| "learning_rate": 3.8618777822278854e-07, | |
| "loss": 0.2988, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 2.7333333333333334, | |
| "grad_norm": 3.460480838422593, | |
| "learning_rate": 2.5074579658471266e-07, | |
| "loss": 0.3141, | |
| "step": 410 | |
| }, | |
| { | |
| "epoch": 2.8, | |
| "grad_norm": 4.457942826192486, | |
| "learning_rate": 1.438663885441982e-07, | |
| "loss": 0.3212, | |
| "step": 420 | |
| }, | |
| { | |
| "epoch": 2.8666666666666667, | |
| "grad_norm": 6.1121678228598775, | |
| "learning_rate": 6.61923394371039e-08, | |
| "loss": 0.2986, | |
| "step": 430 | |
| }, | |
| { | |
| "epoch": 2.9333333333333336, | |
| "grad_norm": 5.213847822695001, | |
| "learning_rate": 1.8190790134231528e-08, | |
| "loss": 0.3053, | |
| "step": 440 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "grad_norm": 5.718900553516974, | |
| "learning_rate": 1.504276011621286e-10, | |
| "loss": 0.3085, | |
| "step": 450 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "step": 450, | |
| "total_flos": 3540344537088.0, | |
| "train_loss": 0.5059795358445909, | |
| "train_runtime": 3284.638, | |
| "train_samples_per_second": 0.822, | |
| "train_steps_per_second": 0.137 | |
| } | |
| ], | |
| "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": 3540344537088.0, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |