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
jerrrrry
infinilm
Commits
45eecde6
Commit
45eecde6
authored
Jul 10, 2025
by
mxCynic
Browse files
fix: Use model_type to determine whether to load scale related parameters
parent
0fca9576
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
scripts/jiuge.py
scripts/jiuge.py
+11
-16
No files found.
scripts/jiuge.py
View file @
45eecde6
...
@@ -90,6 +90,17 @@ class JiugeMetaFromLlama(JiugeMetaCStruct):
...
@@ -90,6 +90,17 @@ class JiugeMetaFromLlama(JiugeMetaCStruct):
dt_
=
DataType
.
INFINI_DTYPE_BF16
dt_
=
DataType
.
INFINI_DTYPE_BF16
else
:
else
:
dt_
=
DataType
.
INFINI_DTYPE_F16
dt_
=
DataType
.
INFINI_DTYPE_F16
scale_input
=
1.0
scale_output
=
1.0
scale_o
=
1.0
scale_down
=
1.0
if
"fm9g"
==
config
[
"model_type"
]:
scale_input
=
config
[
"scale_emb"
]
scale_output
=
config
[
"hidden_size"
]
//
config
[
"dim_model_base"
]
scale_o
=
config
[
"scale_depth"
]
/
math
.
sqrt
(
config
[
"num_hidden_layers"
])
scale_down
=
config
[
"scale_depth"
]
/
math
.
sqrt
(
config
[
"num_hidden_layers"
])
super
().
__init__
(
super
().
__init__
(
dt_logits
=
dt_
,
dt_logits
=
dt_
,
nlayer
=
config
[
"num_hidden_layers"
],
nlayer
=
config
[
"num_hidden_layers"
],
...
@@ -108,22 +119,6 @@ class JiugeMetaFromLlama(JiugeMetaCStruct):
...
@@ -108,22 +119,6 @@ class JiugeMetaFromLlama(JiugeMetaCStruct):
dvoc
=
config
[
"vocab_size"
],
dvoc
=
config
[
"vocab_size"
],
epsilon
=
config
[
"rms_norm_eps"
],
epsilon
=
config
[
"rms_norm_eps"
],
theta
=
(
config
[
"rope_theta"
]
if
"rope_theta"
in
config
else
100000.0
),
theta
=
(
config
[
"rope_theta"
]
if
"rope_theta"
in
config
else
100000.0
),
scale_input
=
(
config
[
"scale_emb"
]
if
"scale_emb"
in
config
else
1.0
),
scale_output
=
(
config
[
"hidden_size"
]
//
config
[
"dim_model_base"
]
if
"dim_model_base"
in
config
else
1.0
),
scale_o
=
(
config
[
"scale_depth"
]
/
math
.
sqrt
(
config
[
"num_hidden_layers"
])
if
"scale_depth"
in
config
else
1.0
),
scale_down
=
(
config
[
"scale_depth"
]
/
math
.
sqrt
(
config
[
"num_hidden_layers"
])
if
"scale_depth"
in
config
else
1.0
),
end_token
=
2
,
end_token
=
2
,
)
)
self
.
torch_dtype_logits
=
dtype
self
.
torch_dtype_logits
=
dtype
...
...
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