Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
3af5d3b7
Unverified
Commit
3af5d3b7
authored
Dec 12, 2025
by
Jeffrey Morgan
Committed by
GitHub
Dec 12, 2025
Browse files
model: force rope factor 1.0 for Gemma 3 (#13445)
parent
77308951
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
model/models/gemma3/model_text.go
model/models/gemma3/model_text.go
+3
-0
No files found.
model/models/gemma3/model_text.go
View file @
3af5d3b7
...
@@ -90,12 +90,15 @@ func newTextModel(c fs.Config) *TextModel {
...
@@ -90,12 +90,15 @@ func newTextModel(c fs.Config) *TextModel {
// Google's Gemma 3 release with sliding window attention does
// Google's Gemma 3 release with sliding window attention does
// not use final logit softcapping, and so force it to 0.0
// not use final logit softcapping, and so force it to 0.0
// The QAT weights for Gemma 3 also included an incorrect
// value for the rope scale, so we need to set it to 1.0 here.
// TODO (jmorganca): this should ideally be set to 0.0 in the
// TODO (jmorganca): this should ideally be set to 0.0 in the
// model configuration instead of here, as future versions of
// model configuration instead of here, as future versions of
// models may include both sliding window attention and final
// models may include both sliding window attention and final
// logit softcapping.
// logit softcapping.
if
slices
.
Contains
(
m
.
TextConfig
.
slidingWindowPattern
,
true
)
{
if
slices
.
Contains
(
m
.
TextConfig
.
slidingWindowPattern
,
true
)
{
m
.
TextConfig
.
finalLogitSoftcap
=
0.0
m
.
TextConfig
.
finalLogitSoftcap
=
0.0
m
.
TextConfig
.
ropeScale
=
1.0
}
}
if
numBlocks
==
gemma27BLayerCount
{
if
numBlocks
==
gemma27BLayerCount
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment