Instructions to use alwaysgood/gemma4-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alwaysgood/gemma4-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="alwaysgood/gemma4-it")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("alwaysgood/gemma4-it") model = AutoModelForImageTextToText.from_pretrained("alwaysgood/gemma4-it") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use alwaysgood/gemma4-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alwaysgood/gemma4-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alwaysgood/gemma4-it", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/alwaysgood/gemma4-it
- SGLang
How to use alwaysgood/gemma4-it 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 "alwaysgood/gemma4-it" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alwaysgood/gemma4-it", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "alwaysgood/gemma4-it" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alwaysgood/gemma4-it", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use alwaysgood/gemma4-it 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 alwaysgood/gemma4-it 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 alwaysgood/gemma4-it to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for alwaysgood/gemma4-it to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="alwaysgood/gemma4-it", max_seq_length=2048, ) - Docker Model Runner
How to use alwaysgood/gemma4-it with Docker Model Runner:
docker model run hf.co/alwaysgood/gemma4-it
Upload final model from sft-gemma4-st3-reversed
Browse files- README.md +5 -5
- all_results.json +8 -8
- config.json +1 -1
- eval_results.json +4 -4
- model.safetensors +1 -1
- train_results.json +4 -4
- trainer_state.json +26 -26
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
---
|
| 2 |
-
base_model: alwaysgood/gemma4-
|
| 3 |
library_name: transformers
|
| 4 |
model_name: checkpoints
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
-
- unsloth
|
| 8 |
-
- trl
|
| 9 |
- sft
|
|
|
|
|
|
|
| 10 |
licence: license
|
| 11 |
---
|
| 12 |
|
| 13 |
# Model Card for checkpoints
|
| 14 |
|
| 15 |
-
This model is a fine-tuned version of [alwaysgood/gemma4-
|
| 16 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 17 |
|
| 18 |
## Quick start
|
|
@@ -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/hiloong/instruction-tuning/runs/
|
| 32 |
|
| 33 |
|
| 34 |
This model was trained with SFT.
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: alwaysgood/gemma4-st2
|
| 3 |
library_name: transformers
|
| 4 |
model_name: checkpoints
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
|
|
|
|
|
|
| 7 |
- sft
|
| 8 |
+
- trl
|
| 9 |
+
- unsloth
|
| 10 |
licence: license
|
| 11 |
---
|
| 12 |
|
| 13 |
# Model Card for checkpoints
|
| 14 |
|
| 15 |
+
This model is a fine-tuned version of [alwaysgood/gemma4-st2](https://huggingface.co/alwaysgood/gemma4-st2).
|
| 16 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 17 |
|
| 18 |
## Quick start
|
|
|
|
| 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/hiloong/instruction-tuning/runs/wddqpt5q)
|
| 32 |
|
| 33 |
|
| 34 |
This model was trained with SFT.
|
all_results.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
-
"eval_loss": 1.
|
| 4 |
-
"eval_runtime":
|
| 5 |
-
"eval_samples_per_second":
|
| 6 |
-
"eval_steps_per_second":
|
| 7 |
"total_flos": 1.054823986446048e+16,
|
| 8 |
-
"train_loss": 1.
|
| 9 |
-
"train_runtime":
|
| 10 |
-
"train_samples_per_second":
|
| 11 |
-
"train_steps_per_second": 0.
|
| 12 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
+
"eval_loss": 1.1255158185958862,
|
| 4 |
+
"eval_runtime": 7.6733,
|
| 5 |
+
"eval_samples_per_second": 9.383,
|
| 6 |
+
"eval_steps_per_second": 1.173,
|
| 7 |
"total_flos": 1.054823986446048e+16,
|
| 8 |
+
"train_loss": 1.251299254099528,
|
| 9 |
+
"train_runtime": 241.5055,
|
| 10 |
+
"train_samples_per_second": 14.753,
|
| 11 |
+
"train_steps_per_second": 0.373
|
| 12 |
}
|
config.json
CHANGED
|
@@ -53,7 +53,7 @@
|
|
| 53 |
"eos_token_id": 1,
|
| 54 |
"image_token_id": 258880,
|
| 55 |
"initializer_range": 0.02,
|
| 56 |
-
"model_name": "alwaysgood/gemma4-
|
| 57 |
"model_type": "gemma4",
|
| 58 |
"pad_token_id": 0,
|
| 59 |
"text_config": {
|
|
|
|
| 53 |
"eos_token_id": 1,
|
| 54 |
"image_token_id": 258880,
|
| 55 |
"initializer_range": 0.02,
|
| 56 |
+
"model_name": "alwaysgood/gemma4-st2",
|
| 57 |
"model_type": "gemma4",
|
| 58 |
"pad_token_id": 0,
|
| 59 |
"text_config": {
|
eval_results.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
-
"eval_loss": 1.
|
| 4 |
-
"eval_runtime":
|
| 5 |
-
"eval_samples_per_second":
|
| 6 |
-
"eval_steps_per_second":
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
+
"eval_loss": 1.1255158185958862,
|
| 4 |
+
"eval_runtime": 7.6733,
|
| 5 |
+
"eval_samples_per_second": 9.383,
|
| 6 |
+
"eval_steps_per_second": 1.173
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 10208852910
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2801109bf570b752396c0b0188bf531de3886b87c5f18a13dde556a390ab2e2f
|
| 3 |
size 10208852910
|
train_results.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
"total_flos": 1.054823986446048e+16,
|
| 4 |
-
"train_loss": 1.
|
| 5 |
-
"train_runtime":
|
| 6 |
-
"train_samples_per_second":
|
| 7 |
-
"train_steps_per_second": 0.
|
| 8 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
"total_flos": 1.054823986446048e+16,
|
| 4 |
+
"train_loss": 1.251299254099528,
|
| 5 |
+
"train_runtime": 241.5055,
|
| 6 |
+
"train_samples_per_second": 14.753,
|
| 7 |
+
"train_steps_per_second": 0.373
|
| 8 |
}
|
trainer_state.json
CHANGED
|
@@ -11,83 +11,83 @@
|
|
| 11 |
"log_history": [
|
| 12 |
{
|
| 13 |
"epoch": 0.11204481792717087,
|
| 14 |
-
"grad_norm":
|
| 15 |
"learning_rate": 1e-05,
|
| 16 |
-
"loss": 1.
|
| 17 |
"step": 10
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"epoch": 0.22408963585434175,
|
| 21 |
-
"grad_norm":
|
| 22 |
"learning_rate": 9.628619846344453e-06,
|
| 23 |
-
"loss": 1.
|
| 24 |
"step": 20
|
| 25 |
},
|
| 26 |
{
|
| 27 |
"epoch": 0.33613445378151263,
|
| 28 |
-
"grad_norm":
|
| 29 |
"learning_rate": 8.569648672789496e-06,
|
| 30 |
-
"loss": 1.
|
| 31 |
"step": 30
|
| 32 |
},
|
| 33 |
{
|
| 34 |
"epoch": 0.4481792717086835,
|
| 35 |
-
"grad_norm":
|
| 36 |
"learning_rate": 6.980398830195785e-06,
|
| 37 |
-
"loss": 1.
|
| 38 |
"step": 40
|
| 39 |
},
|
| 40 |
{
|
| 41 |
"epoch": 0.5602240896358543,
|
| 42 |
-
"grad_norm":
|
| 43 |
"learning_rate": 5.096956658859122e-06,
|
| 44 |
-
"loss": 1.
|
| 45 |
"step": 50
|
| 46 |
},
|
| 47 |
{
|
| 48 |
"epoch": 0.6722689075630253,
|
| 49 |
-
"grad_norm":
|
| 50 |
"learning_rate": 3.1991113759764493e-06,
|
| 51 |
-
"loss": 1.
|
| 52 |
"step": 60
|
| 53 |
},
|
| 54 |
{
|
| 55 |
"epoch": 0.7843137254901961,
|
| 56 |
-
"grad_norm":
|
| 57 |
"learning_rate": 1.5687918106563326e-06,
|
| 58 |
-
"loss": 1.
|
| 59 |
"step": 70
|
| 60 |
},
|
| 61 |
{
|
| 62 |
"epoch": 0.896358543417367,
|
| 63 |
-
"grad_norm":
|
| 64 |
"learning_rate": 4.481852951692672e-07,
|
| 65 |
-
"loss": 1.
|
| 66 |
"step": 80
|
| 67 |
},
|
| 68 |
{
|
| 69 |
"epoch": 1.0,
|
| 70 |
-
"grad_norm": 53.
|
| 71 |
"learning_rate": 3.760237478849793e-09,
|
| 72 |
-
"loss": 1.
|
| 73 |
"step": 90
|
| 74 |
},
|
| 75 |
{
|
| 76 |
"epoch": 1.0,
|
| 77 |
-
"eval_loss": 1.
|
| 78 |
-
"eval_runtime":
|
| 79 |
-
"eval_samples_per_second":
|
| 80 |
-
"eval_steps_per_second": 1.
|
| 81 |
"step": 90
|
| 82 |
},
|
| 83 |
{
|
| 84 |
"epoch": 1.0,
|
| 85 |
"step": 90,
|
| 86 |
"total_flos": 1.054823986446048e+16,
|
| 87 |
-
"train_loss": 1.
|
| 88 |
-
"train_runtime":
|
| 89 |
-
"train_samples_per_second":
|
| 90 |
-
"train_steps_per_second": 0.
|
| 91 |
}
|
| 92 |
],
|
| 93 |
"logging_steps": 10,
|
|
|
|
| 11 |
"log_history": [
|
| 12 |
{
|
| 13 |
"epoch": 0.11204481792717087,
|
| 14 |
+
"grad_norm": 29.25,
|
| 15 |
"learning_rate": 1e-05,
|
| 16 |
+
"loss": 1.3767690658569336,
|
| 17 |
"step": 10
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"epoch": 0.22408963585434175,
|
| 21 |
+
"grad_norm": 23.0,
|
| 22 |
"learning_rate": 9.628619846344453e-06,
|
| 23 |
+
"loss": 1.287515354156494,
|
| 24 |
"step": 20
|
| 25 |
},
|
| 26 |
{
|
| 27 |
"epoch": 0.33613445378151263,
|
| 28 |
+
"grad_norm": 18.0,
|
| 29 |
"learning_rate": 8.569648672789496e-06,
|
| 30 |
+
"loss": 1.2844683647155761,
|
| 31 |
"step": 30
|
| 32 |
},
|
| 33 |
{
|
| 34 |
"epoch": 0.4481792717086835,
|
| 35 |
+
"grad_norm": 14.3125,
|
| 36 |
"learning_rate": 6.980398830195785e-06,
|
| 37 |
+
"loss": 1.2283113479614258,
|
| 38 |
"step": 40
|
| 39 |
},
|
| 40 |
{
|
| 41 |
"epoch": 0.5602240896358543,
|
| 42 |
+
"grad_norm": 14.8125,
|
| 43 |
"learning_rate": 5.096956658859122e-06,
|
| 44 |
+
"loss": 1.1659849166870118,
|
| 45 |
"step": 50
|
| 46 |
},
|
| 47 |
{
|
| 48 |
"epoch": 0.6722689075630253,
|
| 49 |
+
"grad_norm": 15.125,
|
| 50 |
"learning_rate": 3.1991113759764493e-06,
|
| 51 |
+
"loss": 1.2485424995422363,
|
| 52 |
"step": 60
|
| 53 |
},
|
| 54 |
{
|
| 55 |
"epoch": 0.7843137254901961,
|
| 56 |
+
"grad_norm": 12.875,
|
| 57 |
"learning_rate": 1.5687918106563326e-06,
|
| 58 |
+
"loss": 1.2000310897827149,
|
| 59 |
"step": 70
|
| 60 |
},
|
| 61 |
{
|
| 62 |
"epoch": 0.896358543417367,
|
| 63 |
+
"grad_norm": 17.5,
|
| 64 |
"learning_rate": 4.481852951692672e-07,
|
| 65 |
+
"loss": 1.219639205932617,
|
| 66 |
"step": 80
|
| 67 |
},
|
| 68 |
{
|
| 69 |
"epoch": 1.0,
|
| 70 |
+
"grad_norm": 53.0,
|
| 71 |
"learning_rate": 3.760237478849793e-09,
|
| 72 |
+
"loss": 1.250431442260742,
|
| 73 |
"step": 90
|
| 74 |
},
|
| 75 |
{
|
| 76 |
"epoch": 1.0,
|
| 77 |
+
"eval_loss": 1.125481128692627,
|
| 78 |
+
"eval_runtime": 7.4107,
|
| 79 |
+
"eval_samples_per_second": 9.716,
|
| 80 |
+
"eval_steps_per_second": 1.214,
|
| 81 |
"step": 90
|
| 82 |
},
|
| 83 |
{
|
| 84 |
"epoch": 1.0,
|
| 85 |
"step": 90,
|
| 86 |
"total_flos": 1.054823986446048e+16,
|
| 87 |
+
"train_loss": 1.251299254099528,
|
| 88 |
+
"train_runtime": 241.5055,
|
| 89 |
+
"train_samples_per_second": 14.753,
|
| 90 |
+
"train_steps_per_second": 0.373
|
| 91 |
}
|
| 92 |
],
|
| 93 |
"logging_steps": 10,
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5777
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4fc372f6e22c3b97a824f3cd3eb9fd8288225b67895aaa0386f45245b33d0292
|
| 3 |
size 5777
|