Instructions to use alwaysgood/gemma4-st2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alwaysgood/gemma4-st2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="alwaysgood/gemma4-st2")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("alwaysgood/gemma4-st2") model = AutoModelForImageTextToText.from_pretrained("alwaysgood/gemma4-st2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use alwaysgood/gemma4-st2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alwaysgood/gemma4-st2" # 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-st2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/alwaysgood/gemma4-st2
- SGLang
How to use alwaysgood/gemma4-st2 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-st2" \ --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-st2", "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-st2" \ --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-st2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio new
How to use alwaysgood/gemma4-st2 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-st2 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-st2 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-st2 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="alwaysgood/gemma4-st2", max_seq_length=2048, ) - Docker Model Runner
How to use alwaysgood/gemma4-st2 with Docker Model Runner:
docker model run hf.co/alwaysgood/gemma4-st2
File size: 2,718 Bytes
a74656f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | {
"best_global_step": null,
"best_metric": null,
"best_model_checkpoint": null,
"epoch": 1.0,
"eval_steps": 500,
"global_step": 90,
"is_hyper_param_search": false,
"is_local_process_zero": true,
"is_world_process_zero": true,
"log_history": [
{
"epoch": 0.11204481792717087,
"grad_norm": 40.25,
"learning_rate": 1e-05,
"loss": 2.609230613708496,
"step": 10
},
{
"epoch": 0.22408963585434175,
"grad_norm": 14.0625,
"learning_rate": 9.628619846344453e-06,
"loss": 2.171901512145996,
"step": 20
},
{
"epoch": 0.33613445378151263,
"grad_norm": 13.375,
"learning_rate": 8.569648672789496e-06,
"loss": 2.157339096069336,
"step": 30
},
{
"epoch": 0.4481792717086835,
"grad_norm": 37.0,
"learning_rate": 6.980398830195785e-06,
"loss": 2.139277458190918,
"step": 40
},
{
"epoch": 0.5602240896358543,
"grad_norm": 11.375,
"learning_rate": 5.096956658859122e-06,
"loss": 2.022007942199707,
"step": 50
},
{
"epoch": 0.6722689075630253,
"grad_norm": 11.5625,
"learning_rate": 3.1991113759764493e-06,
"loss": 2.084817314147949,
"step": 60
},
{
"epoch": 0.7843137254901961,
"grad_norm": 11.875,
"learning_rate": 1.5687918106563326e-06,
"loss": 2.074056053161621,
"step": 70
},
{
"epoch": 0.896358543417367,
"grad_norm": 12.5,
"learning_rate": 4.481852951692672e-07,
"loss": 2.1064525604248048,
"step": 80
},
{
"epoch": 1.0,
"grad_norm": 61.5,
"learning_rate": 3.760237478849793e-09,
"loss": 2.1725065231323244,
"step": 90
},
{
"epoch": 1.0,
"eval_loss": 1.973793625831604,
"eval_runtime": 3.3988,
"eval_samples_per_second": 21.184,
"eval_steps_per_second": 2.648,
"step": 90
},
{
"epoch": 1.0,
"step": 90,
"total_flos": 9299379063137280.0,
"train_loss": 2.1708432303534613,
"train_runtime": 176.9852,
"train_samples_per_second": 20.132,
"train_steps_per_second": 0.509
}
],
"logging_steps": 10,
"max_steps": 90,
"num_input_tokens_seen": 0,
"num_train_epochs": 1,
"save_steps": 200,
"stateful_callbacks": {
"TrainerControl": {
"args": {
"should_epoch_stop": false,
"should_evaluate": false,
"should_log": false,
"should_save": true,
"should_training_stop": true
},
"attributes": {}
}
},
"total_flos": 9299379063137280.0,
"train_batch_size": 10,
"trial_name": null,
"trial_params": null
}
|