Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use YahanYu/sft-parse_only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YahanYu/sft-parse_only with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="YahanYu/sft-parse_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-parse_only") model = AutoModelForMultimodalLM.from_pretrained("YahanYu/sft-parse_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-parse_only with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "YahanYu/sft-parse_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-parse_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-parse_only
- SGLang
How to use YahanYu/sft-parse_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-parse_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-parse_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-parse_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-parse_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-parse_only with Docker Model Runner:
docker model run hf.co/YahanYu/sft-parse_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": 15.258421482883884, | |
| "learning_rate": 2.0000000000000003e-06, | |
| "loss": 1.3154, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.13333333333333333, | |
| "grad_norm": 7.205159834711116, | |
| "learning_rate": 4.222222222222223e-06, | |
| "loss": 0.6762, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.2, | |
| "grad_norm": 5.286208496607768, | |
| "learning_rate": 6.444444444444445e-06, | |
| "loss": 0.3755, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.26666666666666666, | |
| "grad_norm": 5.387319252024765, | |
| "learning_rate": 8.666666666666668e-06, | |
| "loss": 0.3834, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.3333333333333333, | |
| "grad_norm": 5.639907698577868, | |
| "learning_rate": 9.997593339404757e-06, | |
| "loss": 0.3043, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.4, | |
| "grad_norm": 4.7044181916563526, | |
| "learning_rate": 9.970545007734807e-06, | |
| "loss": 0.2554, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.4666666666666667, | |
| "grad_norm": 3.682087638254962, | |
| "learning_rate": 9.913603233532067e-06, | |
| "loss": 0.2907, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.5333333333333333, | |
| "grad_norm": 3.6588152329619734, | |
| "learning_rate": 9.827110471326612e-06, | |
| "loss": 0.256, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.6, | |
| "grad_norm": 7.98822013389878, | |
| "learning_rate": 9.711586898767462e-06, | |
| "loss": 0.2812, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.6666666666666666, | |
| "grad_norm": 3.121265753795544, | |
| "learning_rate": 9.567727288213005e-06, | |
| "loss": 0.2232, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.7333333333333333, | |
| "grad_norm": 4.070624889104144, | |
| "learning_rate": 9.396396828288272e-06, | |
| "loss": 0.2852, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.8, | |
| "grad_norm": 3.1807820452836575, | |
| "learning_rate": 9.19862592053875e-06, | |
| "loss": 0.2733, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.8666666666666667, | |
| "grad_norm": 2.9701726849981545, | |
| "learning_rate": 8.97560398247424e-06, | |
| "loss": 0.2427, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.9333333333333333, | |
| "grad_norm": 4.895942711906204, | |
| "learning_rate": 8.728672294272009e-06, | |
| "loss": 0.232, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "grad_norm": 3.610345339998106, | |
| "learning_rate": 8.45931593215998e-06, | |
| "loss": 0.2391, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 1.0666666666666667, | |
| "grad_norm": 2.8816345427702563, | |
| "learning_rate": 8.16915483699355e-06, | |
| "loss": 0.1812, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 1.1333333333333333, | |
| "grad_norm": 5.229765759467208, | |
| "learning_rate": 7.859934071740693e-06, | |
| "loss": 0.2065, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 1.2, | |
| "grad_norm": 2.657013649910079, | |
| "learning_rate": 7.533513326467911e-06, | |
| "loss": 0.16, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 1.2666666666666666, | |
| "grad_norm": 4.69223482302914, | |
| "learning_rate": 7.191855733945388e-06, | |
| "loss": 0.1979, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 1.3333333333333333, | |
| "grad_norm": 2.897253133288809, | |
| "learning_rate": 6.837016063135491e-06, | |
| "loss": 0.1839, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 1.4, | |
| "grad_norm": 6.160633399829199, | |
| "learning_rate": 6.4711283615704755e-06, | |
| "loss": 0.1839, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 1.4666666666666668, | |
| "grad_norm": 2.530292589936722, | |
| "learning_rate": 6.0963931209395165e-06, | |
| "loss": 0.1883, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 1.5333333333333332, | |
| "grad_norm": 3.100076582176232, | |
| "learning_rate": 5.715064043072771e-06, | |
| "loss": 0.1877, | |
| "step": 230 | |
| }, | |
| { | |
| "epoch": 1.6, | |
| "grad_norm": 2.796142338358061, | |
| "learning_rate": 5.329434485913393e-06, | |
| "loss": 0.1502, | |
| "step": 240 | |
| }, | |
| { | |
| "epoch": 1.6666666666666665, | |
| "grad_norm": 2.5558465886582136, | |
| "learning_rate": 4.941823670993016e-06, | |
| "loss": 0.1354, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 1.7333333333333334, | |
| "grad_norm": 2.0765048875067302, | |
| "learning_rate": 4.5545627353605705e-06, | |
| "loss": 0.1591, | |
| "step": 260 | |
| }, | |
| { | |
| "epoch": 1.8, | |
| "grad_norm": 2.329178605863745, | |
| "learning_rate": 4.1699807118497815e-06, | |
| "loss": 0.1743, | |
| "step": 270 | |
| }, | |
| { | |
| "epoch": 1.8666666666666667, | |
| "grad_norm": 3.5652046627460456, | |
| "learning_rate": 3.790390522001662e-06, | |
| "loss": 0.1586, | |
| "step": 280 | |
| }, | |
| { | |
| "epoch": 1.9333333333333333, | |
| "grad_norm": 3.3864257912208138, | |
| "learning_rate": 3.418075065882217e-06, | |
| "loss": 0.1477, | |
| "step": 290 | |
| }, | |
| { | |
| "epoch": 2.0, | |
| "grad_norm": 2.5711200031412837, | |
| "learning_rate": 3.0552734924528304e-06, | |
| "loss": 0.1538, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 2.066666666666667, | |
| "grad_norm": 1.924722129321386, | |
| "learning_rate": 2.7041677330649408e-06, | |
| "loss": 0.1007, | |
| "step": 310 | |
| }, | |
| { | |
| "epoch": 2.1333333333333333, | |
| "grad_norm": 2.3483478524592183, | |
| "learning_rate": 2.3668693790681634e-06, | |
| "loss": 0.0802, | |
| "step": 320 | |
| }, | |
| { | |
| "epoch": 2.2, | |
| "grad_norm": 1.577834395885665, | |
| "learning_rate": 2.0454069824514445e-06, | |
| "loss": 0.0823, | |
| "step": 330 | |
| }, | |
| { | |
| "epoch": 2.2666666666666666, | |
| "grad_norm": 2.2718997451337763, | |
| "learning_rate": 1.7417138558927244e-06, | |
| "loss": 0.0715, | |
| "step": 340 | |
| }, | |
| { | |
| "epoch": 2.3333333333333335, | |
| "grad_norm": 1.9475913020710347, | |
| "learning_rate": 1.4576164455890014e-06, | |
| "loss": 0.0826, | |
| "step": 350 | |
| }, | |
| { | |
| "epoch": 2.4, | |
| "grad_norm": 2.611938546404894, | |
| "learning_rate": 1.1948233467939978e-06, | |
| "loss": 0.0756, | |
| "step": 360 | |
| }, | |
| { | |
| "epoch": 2.466666666666667, | |
| "grad_norm": 2.677986923930692, | |
| "learning_rate": 9.549150281252633e-07, | |
| "loss": 0.0662, | |
| "step": 370 | |
| }, | |
| { | |
| "epoch": 2.533333333333333, | |
| "grad_norm": 3.2039719549929067, | |
| "learning_rate": 7.393343264399439e-07, | |
| "loss": 0.0713, | |
| "step": 380 | |
| }, | |
| { | |
| "epoch": 2.6, | |
| "grad_norm": 2.132277408238899, | |
| "learning_rate": 5.493777694441521e-07, | |
| "loss": 0.0783, | |
| "step": 390 | |
| }, | |
| { | |
| "epoch": 2.6666666666666665, | |
| "grad_norm": 3.137037694968375, | |
| "learning_rate": 3.8618777822278854e-07, | |
| "loss": 0.0778, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 2.7333333333333334, | |
| "grad_norm": 3.1060734099015535, | |
| "learning_rate": 2.5074579658471266e-07, | |
| "loss": 0.0907, | |
| "step": 410 | |
| }, | |
| { | |
| "epoch": 2.8, | |
| "grad_norm": 2.394929773928265, | |
| "learning_rate": 1.438663885441982e-07, | |
| "loss": 0.077, | |
| "step": 420 | |
| }, | |
| { | |
| "epoch": 2.8666666666666667, | |
| "grad_norm": 2.0694953586060745, | |
| "learning_rate": 6.61923394371039e-08, | |
| "loss": 0.0728, | |
| "step": 430 | |
| }, | |
| { | |
| "epoch": 2.9333333333333336, | |
| "grad_norm": 2.6670708447263825, | |
| "learning_rate": 1.8190790134231528e-08, | |
| "loss": 0.0765, | |
| "step": 440 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "grad_norm": 2.231811698881225, | |
| "learning_rate": 1.504276011621286e-10, | |
| "loss": 0.0776, | |
| "step": 450 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "step": 450, | |
| "total_flos": 5317199314944.0, | |
| "train_loss": 0.2085215973854065, | |
| "train_runtime": 3072.674, | |
| "train_samples_per_second": 0.879, | |
| "train_steps_per_second": 0.146 | |
| } | |
| ], | |
| "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": 5317199314944.0, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |