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
9679520e
Commit
9679520e
authored
Jul 24, 2025
by
Michael Yang
Browse files
handle safetensors U8
parent
c8ac4cc5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
convert/reader_safetensors.go
convert/reader_safetensors.go
+3
-0
No files found.
convert/reader_safetensors.go
View file @
9679520e
...
@@ -150,6 +150,9 @@ func (st safetensor) WriteTo(w io.Writer) (int64, error) {
...
@@ -150,6 +150,9 @@ func (st safetensor) WriteTo(w io.Writer) (int64, error) {
}
}
f32s
=
bfloat16
.
DecodeFloat32
(
u8s
)
f32s
=
bfloat16
.
DecodeFloat32
(
u8s
)
case
"U8"
:
// U8 tensors do not support repacking or type conversion.
return
io
.
CopyN
(
w
,
f
,
st
.
size
)
default
:
default
:
return
0
,
fmt
.
Errorf
(
"unknown data type: %s"
,
st
.
dtype
)
return
0
,
fmt
.
Errorf
(
"unknown data type: %s"
,
st
.
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