Image-Text-to-Text
Transformers
Safetensors
gemma3
Generated from Trainer
trl
sft
conversational
text-generation-inference
Instructions to use burtenshaw/GemmaCoder3-12B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use burtenshaw/GemmaCoder3-12B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="burtenshaw/GemmaCoder3-12B") 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("burtenshaw/GemmaCoder3-12B") model = AutoModelForMultimodalLM.from_pretrained("burtenshaw/GemmaCoder3-12B", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use burtenshaw/GemmaCoder3-12B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "burtenshaw/GemmaCoder3-12B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "burtenshaw/GemmaCoder3-12B", "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/burtenshaw/GemmaCoder3-12B
- SGLang
How to use burtenshaw/GemmaCoder3-12B 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 "burtenshaw/GemmaCoder3-12B" \ --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": "burtenshaw/GemmaCoder3-12B", "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 "burtenshaw/GemmaCoder3-12B" \ --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": "burtenshaw/GemmaCoder3-12B", "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 burtenshaw/GemmaCoder3-12B with Docker Model Runner:
docker model run hf.co/burtenshaw/GemmaCoder3-12B
End of training
Browse files- README.md +3 -3
- generation_config.json +4 -2
README.md
CHANGED
|
@@ -28,15 +28,15 @@ 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/smartwithfood/huggingface/runs/
|
| 32 |
|
| 33 |
|
| 34 |
This model was trained with SFT.
|
| 35 |
|
| 36 |
### Framework versions
|
| 37 |
|
| 38 |
-
- TRL: 0.
|
| 39 |
-
- Transformers: 4.
|
| 40 |
- Pytorch: 2.6.0
|
| 41 |
- Datasets: 3.4.1
|
| 42 |
- Tokenizers: 0.21.1
|
|
|
|
| 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/smartwithfood/huggingface/runs/mv5o1o6k)
|
| 32 |
|
| 33 |
|
| 34 |
This model was trained with SFT.
|
| 35 |
|
| 36 |
### Framework versions
|
| 37 |
|
| 38 |
+
- TRL: 0.17.0.dev0
|
| 39 |
+
- Transformers: 4.51.0.dev0
|
| 40 |
- Pytorch: 2.6.0
|
| 41 |
- Datasets: 3.4.1
|
| 42 |
- Tokenizers: 0.21.1
|
generation_config.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
{
|
| 2 |
-
"_from_model_config": true,
|
| 3 |
"bos_token_id": 2,
|
| 4 |
"cache_implementation": "hybrid",
|
|
|
|
| 5 |
"eos_token_id": [
|
| 6 |
1,
|
| 7 |
106
|
| 8 |
],
|
| 9 |
"pad_token_id": 0,
|
| 10 |
-
"
|
|
|
|
|
|
|
| 11 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"bos_token_id": 2,
|
| 3 |
"cache_implementation": "hybrid",
|
| 4 |
+
"do_sample": true,
|
| 5 |
"eos_token_id": [
|
| 6 |
1,
|
| 7 |
106
|
| 8 |
],
|
| 9 |
"pad_token_id": 0,
|
| 10 |
+
"top_k": 64,
|
| 11 |
+
"top_p": 0.95,
|
| 12 |
+
"transformers_version": "4.51.0.dev0"
|
| 13 |
}
|