Image-Text-to-Text
Transformers
Safetensors
qwen3_5
compiwer-ai
mtrini
svl
reasoning
moroccan-darija
conversational
Instructions to use CompiwerAI/Mtrini-SVL-2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CompiwerAI/Mtrini-SVL-2.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="CompiwerAI/Mtrini-SVL-2.0") 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("CompiwerAI/Mtrini-SVL-2.0") model = AutoModelForMultimodalLM.from_pretrained("CompiwerAI/Mtrini-SVL-2.0", 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 CompiwerAI/Mtrini-SVL-2.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CompiwerAI/Mtrini-SVL-2.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CompiwerAI/Mtrini-SVL-2.0", "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/CompiwerAI/Mtrini-SVL-2.0
- SGLang
How to use CompiwerAI/Mtrini-SVL-2.0 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 "CompiwerAI/Mtrini-SVL-2.0" \ --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": "CompiwerAI/Mtrini-SVL-2.0", "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 "CompiwerAI/Mtrini-SVL-2.0" \ --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": "CompiwerAI/Mtrini-SVL-2.0", "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 CompiwerAI/Mtrini-SVL-2.0 with Docker Model Runner:
docker model run hf.co/CompiwerAI/Mtrini-SVL-2.0
Download training_log.json from CompiwerAI/Mtrini-SVL-2.0: direct link, hf CLI and curl.
- Browser
- Download file 9.07 kB
-
https://huggingface.co/CompiwerAI/Mtrini-SVL-2.0/resolve/main/training_log.json
- Command line
-
hf download hf://CompiwerAI/Mtrini-SVL-2.0/training_log.json
-
curl -L -o training_log.json https://huggingface.co/CompiwerAI/Mtrini-SVL-2.0/resolve/main/training_log.json
9.07 kB
| [{"loss": 1.0188085556030273, "grad_norm": 0.6273626089096069, "learning_rate": 1.5e-05, "entropy": 0.9755867037922143, "mean_token_accuracy": 0.7209798842668533, "num_tokens": 281169.0, "epoch": 0.019885657469550087, "step": 5}, {"loss": 0.8944797515869141, "grad_norm": 0.489018976688385, "learning_rate": 2.9998756701652316e-05, "entropy": 0.8679021390737034, "mean_token_accuracy": 0.7530542567372323, "num_tokens": 570484.0, "epoch": 0.039771314939100175, "step": 10}, {"loss": 1.048586654663086, "grad_norm": 0.4235870838165283, "learning_rate": 2.99552628967279e-05, "entropy": 1.0637087469920516, "mean_token_accuracy": 0.7153279848396779, "num_tokens": 836075.0, "epoch": 0.05965697240865026, "step": 15}, {"loss": 0.9067628860473633, "grad_norm": 0.9827362895011902, "learning_rate": 2.9849810126330072e-05, "entropy": 0.9412206708919257, "mean_token_accuracy": 0.7451499074697494, "num_tokens": 1107572.0, "epoch": 0.07954262987820035, "step": 20}, {"loss": 1.001968765258789, "grad_norm": 0.7683970928192139, "learning_rate": 2.9682835276430367e-05, "entropy": 1.0140768527053297, "mean_token_accuracy": 0.7408814176917076, "num_tokens": 1308256.0, "epoch": 0.09942828734775043, "step": 25}, {"loss": 0.902683162689209, "grad_norm": 0.5447065234184265, "learning_rate": 2.9455030116142526e-05, "entropy": 0.894320057798177, "mean_token_accuracy": 0.757544657588005, "num_tokens": 1547905.0, "epoch": 0.11931394481730052, "step": 30}, {"loss": 0.9008851051330566, "grad_norm": 0.7535042762756348, "learning_rate": 2.916733843175492e-05, "entropy": 0.9044961070641875, "mean_token_accuracy": 0.7503336206078529, "num_tokens": 1792282.0, "epoch": 0.1391996022868506, "step": 35}, {"loss": 1.0788708686828614, "grad_norm": 0.43524274230003357, "learning_rate": 2.882095211666742e-05, "entropy": 1.0634986386168748, "mean_token_accuracy": 0.7155817538499832, "num_tokens": 2058503.0, "epoch": 0.1590852597564007, "step": 40}, {"loss": 0.85924072265625, "grad_norm": 0.9773867726325989, "learning_rate": 2.8417306233431936e-05, "entropy": 0.8765395330614411, "mean_token_accuracy": 0.7586436599493027, "num_tokens": 2325608.0, "epoch": 0.1789709172259508, "step": 45}, {"loss": 0.8571704864501953, "grad_norm": 0.963769793510437, "learning_rate": 2.795807306835433e-05, "entropy": 0.8754309836775065, "mean_token_accuracy": 0.7605248048901558, "num_tokens": 2568011.0, "epoch": 0.19885657469550086, "step": 50}, {"loss": 0.9195894241333008, "grad_norm": 3.2245285511016846, "learning_rate": 2.7445155203289283e-05, "entropy": 0.9049483237846289, "mean_token_accuracy": 0.7529003605246544, "num_tokens": 2807039.0, "epoch": 0.21874223216505095, "step": 55}, {"loss": 0.8789840698242187, "grad_norm": 0.7498902678489685, "learning_rate": 2.6880677633331287e-05, "entropy": 0.8872182086110115, "mean_token_accuracy": 0.752416479587555, "num_tokens": 3051338.0, "epoch": 0.23862788963460105, "step": 60}, {"loss": 0.8922389030456543, "grad_norm": 0.5908676385879517, "learning_rate": 2.6266978963057797e-05, "entropy": 0.882320377486758, "mean_token_accuracy": 0.7565870802849531, "num_tokens": 3303722.0, "epoch": 0.25851354710415114, "step": 65}, {"loss": 0.8668020248413086, "grad_norm": 0.688410222530365, "learning_rate": 2.5606601717798212e-05, "entropy": 0.8876771377399564, "mean_token_accuracy": 0.7517788395285606, "num_tokens": 3595753.0, "epoch": 0.2783992045737012, "step": 70}, {"loss": 0.8554845809936523, "grad_norm": 0.4268965423107147, "learning_rate": 2.4902281810068475e-05, "entropy": 0.8945358863682487, "mean_token_accuracy": 0.7630243629217148, "num_tokens": 3841619.0, "epoch": 0.29828486204325133, "step": 75}, {"loss": 1.020158290863037, "grad_norm": 0.5659993886947632, "learning_rate": 2.4156937204811544e-05, "entropy": 1.0202201642212458, "mean_token_accuracy": 0.7293107841163874, "num_tokens": 4072730.0, "epoch": 0.3181705195128014, "step": 80}, {"loss": 0.9544044494628906, "grad_norm": 0.4148193895816803, "learning_rate": 2.337365583040297e-05, "entropy": 0.962729674577713, "mean_token_accuracy": 0.746249570697546, "num_tokens": 4322846.0, "epoch": 0.33805617698235146, "step": 85}, {"loss": 0.8533926963806152, "grad_norm": 0.6280364394187927, "learning_rate": 2.2555682785505906e-05, "entropy": 0.8727328696288168, "mean_token_accuracy": 0.7612973682582378, "num_tokens": 4585097.0, "epoch": 0.3579418344519016, "step": 90}, {"loss": 0.8892879486083984, "grad_norm": 0.3707001507282257, "learning_rate": 2.170640689477671e-05, "entropy": 0.9030258968472481, "mean_token_accuracy": 0.75346759557724, "num_tokens": 4820643.0, "epoch": 0.37782749192145165, "step": 95}, {"loss": 0.9593242645263672, "grad_norm": 0.5425809621810913, "learning_rate": 2.0829346669120507e-05, "entropy": 0.9773733174428344, "mean_token_accuracy": 0.7397669356316328, "num_tokens": 5055894.0, "epoch": 0.3977131493910017, "step": 100}, {"loss": 0.9281060218811035, "grad_norm": 0.5107171535491943, "learning_rate": 1.9928135728662524e-05, "entropy": 0.9483957543969155, "mean_token_accuracy": 0.74555883705616, "num_tokens": 5296651.0, "epoch": 0.41759880686055184, "step": 105}, {"loss": 0.9764922142028809, "grad_norm": 0.4874778985977173, "learning_rate": 1.9006507748827227e-05, "entropy": 0.9654966502916068, "mean_token_accuracy": 0.7439464494585991, "num_tokens": 5552321.0, "epoch": 0.4374844643301019, "step": 110}, {"loss": 0.7932049751281738, "grad_norm": 0.4424755275249481, "learning_rate": 1.8068280991893016e-05, "entropy": 0.8089077941025608, "mean_token_accuracy": 0.7816301502287388, "num_tokens": 5776681.0, "epoch": 0.457370121799652, "step": 115}, {"loss": 0.9486069679260254, "grad_norm": 0.3311132788658142, "learning_rate": 1.7117342488107392e-05, "entropy": 0.9583252403885126, "mean_token_accuracy": 0.7385508444160223, "num_tokens": 6040077.0, "epoch": 0.4772557792692021, "step": 120}, {"loss": 0.9467199325561524, "grad_norm": 0.8966188430786133, "learning_rate": 1.6157631931899696e-05, "entropy": 0.9634561024606227, "mean_token_accuracy": 0.7466258779168129, "num_tokens": 6261441.0, "epoch": 0.49714143673875216, "step": 125}, {"loss": 0.935308837890625, "grad_norm": 0.7671292424201965, "learning_rate": 1.5193125359908474e-05, "entropy": 0.956910348526435, "mean_token_accuracy": 0.7458380788564682, "num_tokens": 6521173.0, "epoch": 0.5170270942083023, "step": 130}, {"loss": 0.9883097648620606, "grad_norm": 0.2238738238811493, "learning_rate": 1.4227818678444802e-05, "entropy": 0.9945129631028976, "mean_token_accuracy": 0.7420312747359276, "num_tokens": 6768655.0, "epoch": 0.5369127516778524, "step": 135}, {"loss": 0.8337902069091797, "grad_norm": 0.3754742443561554, "learning_rate": 1.3265711108636466e-05, "entropy": 0.8479189236357343, "mean_token_accuracy": 0.775602612271905, "num_tokens": 6984717.0, "epoch": 0.5567984091474024, "step": 140}, {"loss": 0.9092901229858399, "grad_norm": 0.5528278946876526, "learning_rate": 1.2310788617838969e-05, "entropy": 0.9175344789400697, "mean_token_accuracy": 0.7466281846165657, "num_tokens": 7249730.0, "epoch": 0.5766840666169525, "step": 145}, {"loss": 0.891572093963623, "grad_norm": 0.6899020671844482, "learning_rate": 1.1367007405956361e-05, "entropy": 0.8923902579816059, "mean_token_accuracy": 0.7449304766952991, "num_tokens": 7530196.0, "epoch": 0.5965697240865027, "step": 150}, {"loss": 0.9514280319213867, "grad_norm": 0.5140228271484375, "learning_rate": 1.0438277515087234e-05, "entropy": 0.9739239290676778, "mean_token_accuracy": 0.74279646538198, "num_tokens": 7756158.0, "epoch": 0.6164553815560527, "step": 155}, {"loss": 0.9265730857849122, "grad_norm": 0.5575122833251953, "learning_rate": 9.528446630400325e-06, "entropy": 0.9340764463646337, "mean_token_accuracy": 0.7402101270854473, "num_tokens": 8025593.0, "epoch": 0.6363410390256028, "step": 160}, {"loss": 0.9336459159851074, "grad_norm": 0.6217585206031799, "learning_rate": 8.641284139352091e-06, "entropy": 0.9505519358441233, "mean_token_accuracy": 0.7479322925209999, "num_tokens": 8271540.0, "epoch": 0.6562266964951529, "step": 165}, {"loss": 0.80654878616333, "grad_norm": 0.2666934132575989, "learning_rate": 7.780465515288055e-06, "entropy": 0.8310101808572654, "mean_token_accuracy": 0.7725368276238441, "num_tokens": 8502371.0, "epoch": 0.6761123539647029, "step": 170}, {"loss": 0.8166940689086915, "grad_norm": 0.3480839729309082, "learning_rate": 6.949557090125994e-06, "entropy": 0.8411112741276157, "mean_token_accuracy": 0.7729913659393788, "num_tokens": 8746741.0, "epoch": 0.695998011434253, "step": 175}, {"loss": 0.9597179412841796, "grad_norm": 1.4963269233703613, "learning_rate": 6.152001279207022e-06, "entropy": 0.9565216006390983, "mean_token_accuracy": 0.7466556373983622, "num_tokens": 8974338.0, "epoch": 0.7158836689038032, "step": 180}, {"train_runtime": 2965.6846, "train_samples_per_second": 0.982, "train_steps_per_second": 0.061, "total_flos": 4.612193321662092e+17, "train_loss": 0.9181669714686634, "entropy": 0.8203286745701917, "mean_token_accuracy": 0.7807957101613283, "num_tokens": 9068484.0, "epoch": 0.7238379318916232, "step": 182}] |