Image-Text-to-Text
Transformers
Safetensors
mistral3
Generated from Trainer
unsloth
sft
trl
conversational
Instructions to use Ba2han/m_augment2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ba2han/m_augment2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Ba2han/m_augment2") 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("Ba2han/m_augment2") model = AutoModelForMultimodalLM.from_pretrained("Ba2han/m_augment2") 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 Ba2han/m_augment2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ba2han/m_augment2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ba2han/m_augment2", "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/Ba2han/m_augment2
- SGLang
How to use Ba2han/m_augment2 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 "Ba2han/m_augment2" \ --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": "Ba2han/m_augment2", "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 "Ba2han/m_augment2" \ --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": "Ba2han/m_augment2", "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" } } ] } ] }' - Unsloth Studio
How to use Ba2han/m_augment2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Ba2han/m_augment2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Ba2han/m_augment2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Ba2han/m_augment2 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Ba2han/m_augment2", max_seq_length=2048, ) - Docker Model Runner
How to use Ba2han/m_augment2 with Docker Model Runner:
docker model run hf.co/Ba2han/m_augment2
Training in progress, step 744
Browse files- README.md +3 -3
- config.json +73 -0
- generation_config.json +9 -0
- model.safetensors +3 -0
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -4,9 +4,9 @@ library_name: transformers
|
|
| 4 |
model_name: m_augment2
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
-
- trl
|
| 8 |
-
- sft
|
| 9 |
- unsloth
|
|
|
|
|
|
|
| 10 |
licence: license
|
| 11 |
---
|
| 12 |
|
|
@@ -28,7 +28,7 @@ print(output["generated_text"])
|
|
| 28 |
|
| 29 |
## Training procedure
|
| 30 |
|
| 31 |
-
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/batuhan409/huggingface/runs/
|
| 32 |
|
| 33 |
|
| 34 |
This model was trained with SFT.
|
|
|
|
| 4 |
model_name: m_augment2
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
|
|
|
|
|
|
| 7 |
- unsloth
|
| 8 |
+
- sft
|
| 9 |
+
- trl
|
| 10 |
licence: license
|
| 11 |
---
|
| 12 |
|
|
|
|
| 28 |
|
| 29 |
## Training procedure
|
| 30 |
|
| 31 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/batuhan409/huggingface/runs/6efuahke)
|
| 32 |
|
| 33 |
|
| 34 |
This model was trained with SFT.
|
config.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Mistral3ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"bos_token_id": 1,
|
| 6 |
+
"dtype": "bfloat16",
|
| 7 |
+
"eos_token_id": 2,
|
| 8 |
+
"image_token_index": 10,
|
| 9 |
+
"model_type": "mistral3",
|
| 10 |
+
"multimodal_projector_bias": false,
|
| 11 |
+
"pad_token_id": 11,
|
| 12 |
+
"projector_hidden_act": "gelu",
|
| 13 |
+
"spatial_merge_size": 2,
|
| 14 |
+
"text_config": {
|
| 15 |
+
"attention_dropout": 0.0,
|
| 16 |
+
"bos_token_id": 1,
|
| 17 |
+
"dtype": "bfloat16",
|
| 18 |
+
"eos_token_id": 2,
|
| 19 |
+
"head_dim": 128,
|
| 20 |
+
"hidden_act": "silu",
|
| 21 |
+
"hidden_size": 3072,
|
| 22 |
+
"initializer_range": 0.02,
|
| 23 |
+
"intermediate_size": 9216,
|
| 24 |
+
"max_position_embeddings": 262144,
|
| 25 |
+
"model_type": "ministral3",
|
| 26 |
+
"num_attention_heads": 32,
|
| 27 |
+
"num_hidden_layers": 26,
|
| 28 |
+
"num_key_value_heads": 8,
|
| 29 |
+
"pad_token_id": 11,
|
| 30 |
+
"rms_norm_eps": 1e-05,
|
| 31 |
+
"rope_parameters": {
|
| 32 |
+
"beta_fast": 32.0,
|
| 33 |
+
"beta_slow": 1.0,
|
| 34 |
+
"factor": 16.0,
|
| 35 |
+
"llama_4_scaling_beta": 0.1,
|
| 36 |
+
"mscale": 1.0,
|
| 37 |
+
"mscale_all_dim": 1.0,
|
| 38 |
+
"original_max_position_embeddings": 16384,
|
| 39 |
+
"rope_theta": 1000000.0,
|
| 40 |
+
"rope_type": "yarn",
|
| 41 |
+
"type": "yarn"
|
| 42 |
+
},
|
| 43 |
+
"sliding_window": null,
|
| 44 |
+
"tie_word_embeddings": true,
|
| 45 |
+
"use_cache": true,
|
| 46 |
+
"vocab_size": 131072
|
| 47 |
+
},
|
| 48 |
+
"tie_word_embeddings": true,
|
| 49 |
+
"transformers_version": "5.0.1.dev0",
|
| 50 |
+
"unsloth_fixed": true,
|
| 51 |
+
"unsloth_version": "2026.1.4",
|
| 52 |
+
"use_cache": false,
|
| 53 |
+
"vision_config": {
|
| 54 |
+
"attention_dropout": 0.0,
|
| 55 |
+
"dtype": "bfloat16",
|
| 56 |
+
"head_dim": 64,
|
| 57 |
+
"hidden_act": "silu",
|
| 58 |
+
"hidden_size": 1024,
|
| 59 |
+
"image_size": 1540,
|
| 60 |
+
"initializer_range": 0.02,
|
| 61 |
+
"intermediate_size": 4096,
|
| 62 |
+
"model_type": "pixtral",
|
| 63 |
+
"num_attention_heads": 16,
|
| 64 |
+
"num_channels": 3,
|
| 65 |
+
"num_hidden_layers": 24,
|
| 66 |
+
"patch_size": 14,
|
| 67 |
+
"rope_parameters": {
|
| 68 |
+
"rope_theta": 10000.0,
|
| 69 |
+
"rope_type": "default"
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
"vision_feature_layer": -1
|
| 73 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 1,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
2
|
| 5 |
+
],
|
| 6 |
+
"max_length": 262144,
|
| 7 |
+
"pad_token_id": 11,
|
| 8 |
+
"transformers_version": "5.0.1.dev0"
|
| 9 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:82cfd8c1220e84d32fa064e6297ac77a4d2a6c16cfed2f784dbb4de5d360c7c4
|
| 3 |
+
size 8503547592
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5713
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2eb58d89dbac60654e5bc9b2c63211f8655fbfd4793522039e73ecdea82b46f6
|
| 3 |
size 5713
|