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
949d7b1c
Unverified
Commit
949d7b1c
authored
Feb 20, 2024
by
Michael Yang
Committed by
GitHub
Feb 20, 2024
Browse files
add gguf file types (#2532)
parent
897b2134
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
llm/ggml.go
llm/ggml.go
+15
-0
llm/gguf.go
llm/gguf.go
+8
-0
No files found.
llm/ggml.go
View file @
949d7b1c
...
@@ -31,6 +31,11 @@ const (
...
@@ -31,6 +31,11 @@ const (
fileTypeQ5_K_S
fileTypeQ5_K_S
fileTypeQ5_K_M
fileTypeQ5_K_M
fileTypeQ6_K
fileTypeQ6_K
fileTypeIQ2_XXS
fileTypeIQ2_XS
fileTypeQ2_K_S
fileTypeQ3_K_XS
fileTypeIQ3_XXS
)
)
func
fileType
(
fileType
uint32
)
string
{
func
fileType
(
fileType
uint32
)
string
{
...
@@ -69,6 +74,16 @@ func fileType(fileType uint32) string {
...
@@ -69,6 +74,16 @@ func fileType(fileType uint32) string {
return
"Q5_K_M"
return
"Q5_K_M"
case
fileTypeQ6_K
:
case
fileTypeQ6_K
:
return
"Q6_K"
return
"Q6_K"
case
fileTypeIQ2_XXS
:
return
"IQ2_XXS"
case
fileTypeIQ2_XS
:
return
"IQ2_XS"
case
fileTypeQ2_K_S
:
return
"Q2_K_S"
case
fileTypeQ3_K_XS
:
return
"Q3_K_XS"
case
fileTypeIQ3_XXS
:
return
"IQ3_XXS"
default
:
default
:
return
"unknown"
return
"unknown"
}
}
...
...
llm/gguf.go
View file @
949d7b1c
...
@@ -115,6 +115,14 @@ func (t tensor) typeSize() uint64 {
...
@@ -115,6 +115,14 @@ func (t tensor) typeSize() uint64 {
return
2
+
2
+
12
+
blockSize
/
8
+
blockSize
/
2
return
2
+
2
+
12
+
blockSize
/
8
+
blockSize
/
2
case
14
:
// Q6_K
case
14
:
// Q6_K
return
blockSize
/
2
+
blockSize
/
4
+
blockSize
/
16
+
2
return
blockSize
/
2
+
blockSize
/
4
+
blockSize
/
16
+
2
case
15
:
// Q8_K
return
2
+
blockSize
+
2
*
blockSize
/
16
case
16
:
// IQ2_XXS
return
2
+
2
*
blockSize
/
8
case
17
:
// IQ2_XS
return
2
+
2
*
blockSize
/
8
+
blockSize
/
32
case
18
:
// IQ3_XXS
return
2
+
3
*
blockSize
/
8
default
:
default
:
return
0
return
0
}
}
...
...
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