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
732c7f04
Commit
732c7f04
authored
Jun 27, 2025
by
Pan Zezhong
Browse files
9G7B support safetensors
parent
c0799551
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
scripts/jiuge.py
scripts/jiuge.py
+10
-5
No files found.
scripts/jiuge.py
View file @
732c7f04
...
@@ -416,11 +416,16 @@ class JiugeForCauslLM:
...
@@ -416,11 +416,16 @@ class JiugeForCauslLM:
else
:
else
:
raise
ValueError
(
"Unsupported weight naming"
)
raise
ValueError
(
"Unsupported weight naming"
)
elif
"fm9g7b"
==
config
[
"model_type"
]:
elif
"fm9g7b"
==
config
[
"model_type"
]:
state_dict
=
torch
.
load
(
if
any
(
os
.
path
.
join
(
model_dir_path
,
"pytorch_model.bin"
),
file
.
suffix
==
".safetensors"
for
file
in
Path
(
model_dir_path
).
iterdir
()
weights_only
=
True
,
):
map_location
=
"cpu"
,
state_dict
=
load_all_safetensors_from_dir
(
model_dir_path
)
)
else
:
state_dict
=
torch
.
load
(
os
.
path
.
join
(
model_dir_path
,
"pytorch_model.bin"
),
weights_only
=
True
,
map_location
=
"cpu"
,
)
if
LlamaWeightsNaming
.
match
(
state_dict
):
if
LlamaWeightsNaming
.
match
(
state_dict
):
self
.
meta
=
JiugeMetaFromLlama
(
config
)
self
.
meta
=
JiugeMetaFromLlama
(
config
)
self
.
weights
=
JiugeWeightsImpl
(
self
.
weights
=
JiugeWeightsImpl
(
...
...
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