Skip to content

Add Gemma 4 model sampling defaults#4838

Merged
danielhanchen merged 1 commit into
mainfrom
feature/gemma-4-sampling-defaults
Apr 3, 2026
Merged

Add Gemma 4 model sampling defaults#4838
danielhanchen merged 1 commit into
mainfrom
feature/gemma-4-sampling-defaults

Conversation

@danielhanchen
Copy link
Copy Markdown
Member

Summary

  • Add per-model YAML configs and MODEL_NAME_MAPPING entries for all 8 Gemma 4 models
  • Add gemma-4 family entry in inference_defaults.json for GGUF variant fallback
  • Sampling defaults match gemma-3n/gemma-3: temperature=1.0, top_p=0.95, top_k=64, min_p=0.0, no repetition or presence penalty

Models covered

Model YAML GGUF
gemma-4-31B-it per-model family fallback
gemma-4-26B-A4B-it per-model family fallback
gemma-4-E2B-it per-model family fallback
gemma-4-E4B-it per-model family fallback
gemma-4-31B per-model N/A
gemma-4-26B-A4B per-model N/A
gemma-4-E2B per-model N/A
gemma-4-E4B per-model N/A

Both unsloth/ and google/ prefixed model IDs are mapped.

Test plan

  • Load any Gemma 4 model in Studio, confirm inference params show temperature=1.0, top_p=0.95, top_k=64, min_p=0.0
  • Load a Gemma 4 GGUF variant, confirm same defaults via family fallback

Add per-model YAML configs and MODEL_NAME_MAPPING entries for all 8
Gemma 4 models (4 instruct + 4 base):
- gemma-4-31B-it / gemma-4-31B
- gemma-4-26B-A4B-it / gemma-4-26B-A4B
- gemma-4-E2B-it / gemma-4-E2B
- gemma-4-E4B-it / gemma-4-E4B

GGUF variants (only for -it models) resolve via the gemma-4 family
entry in inference_defaults.json.

Sampling defaults: temperature=1.0, top_p=0.95, top_k=64, min_p=0.0,
no repetition or presence penalty. Matches gemma-3n and gemma-3.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@danielhanchen danielhanchen merged commit 4f65cc9 into main Apr 3, 2026
5 checks passed
@danielhanchen danielhanchen deleted the feature/gemma-4-sampling-defaults branch April 3, 2026 20:57
shibizhao pushed a commit to shibizhao/unsloth-npu that referenced this pull request Apr 7, 2026
Add per-model YAML configs and MODEL_NAME_MAPPING entries for all 8
Gemma 4 models (4 instruct + 4 base):
- gemma-4-31B-it / gemma-4-31B
- gemma-4-26B-A4B-it / gemma-4-26B-A4B
- gemma-4-E2B-it / gemma-4-E2B
- gemma-4-E4B-it / gemma-4-E4B

GGUF variants (only for -it models) resolve via the gemma-4 family
entry in inference_defaults.json.

Sampling defaults: temperature=1.0, top_p=0.95, top_k=64, min_p=0.0,
no repetition or presence penalty. Matches gemma-3n and gemma-3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant