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
0c5a4543
Commit
0c5a4543
authored
Sep 12, 2023
by
Michael Yang
Browse files
fix model type for 70b
parent
7dee25a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
llm/gguf.go
llm/gguf.go
+6
-0
server/images.go
server/images.go
+9
-3
No files found.
llm/gguf.go
View file @
0c5a4543
...
...
@@ -99,6 +99,12 @@ func (llm *ggufModel) ModelType() string {
switch
llm
.
ModelFamily
()
{
case
"llama"
:
if
blocks
,
ok
:=
llm
.
kv
[
"llama.block_count"
]
.
(
uint32
);
ok
{
heads
,
headsOK
:=
llm
.
kv
[
"llama.head_count"
]
.
(
uint32
)
headKVs
,
headsKVsOK
:=
llm
.
kv
[
"llama.head_count_kv"
]
.
(
uint32
)
if
headsOK
&&
headsKVsOK
&&
heads
/
headKVs
==
8
{
return
"70B"
}
return
llamaModelType
(
blocks
)
}
case
"falcon"
:
...
...
server/images.go
View file @
0c5a4543
...
...
@@ -498,6 +498,12 @@ func CreateModel(ctx context.Context, name string, path string, fn func(resp api
}
}
if
config
.
ModelType
==
"65B"
{
if
numGQA
,
ok
:=
formattedParams
[
"num_gqa"
]
.
(
int
);
ok
&&
numGQA
==
8
{
config
.
ModelType
=
"70B"
}
}
bts
,
err
:=
json
.
Marshal
(
formattedParams
)
if
err
!=
nil
{
return
err
...
...
@@ -815,14 +821,14 @@ func formatParams(params map[string][]string) (map[string]interface{}, error) {
return
nil
,
fmt
.
Errorf
(
"invalid float value %s"
,
vals
)
}
out
[
key
]
=
floatVal
out
[
key
]
=
float32
(
floatVal
)
case
reflect
.
Int
:
intVal
,
err
:=
strconv
.
ParseInt
(
vals
[
0
],
10
,
0
)
intVal
,
err
:=
strconv
.
ParseInt
(
vals
[
0
],
10
,
64
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"invalid int value %s"
,
vals
)
}
out
[
key
]
=
intVal
out
[
key
]
=
int
(
intVal
)
case
reflect
.
Bool
:
boolVal
,
err
:=
strconv
.
ParseBool
(
vals
[
0
])
if
err
!=
nil
{
...
...
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