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
da8e2a04
Commit
da8e2a04
authored
Jun 14, 2024
by
Michael Yang
Browse files
use kvs to detect embedding models
parent
a30915bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
server/images.go
server/images.go
+15
-1
No files found.
server/images.go
View file @
da8e2a04
...
...
@@ -66,7 +66,21 @@ func (m *Model) Has(caps ...Capability) bool {
for
_
,
cap
:=
range
caps
{
switch
cap
{
case
CapabilityCompletion
:
if
slices
.
Contains
(
m
.
Config
.
ModelFamilies
,
"bert"
)
||
slices
.
Contains
(
m
.
Config
.
ModelFamilies
,
"nomic-bert"
)
{
f
,
err
:=
os
.
Open
(
m
.
ModelPath
)
if
err
!=
nil
{
slog
.
Error
(
"couldn't open model file"
,
"error"
,
err
)
continue
}
defer
f
.
Close
()
// TODO(mxyng): decode the GGML into model to avoid doing this multiple times
ggml
,
_
,
err
:=
llm
.
DecodeGGML
(
f
,
0
)
if
err
!=
nil
{
slog
.
Error
(
"couldn't decode ggml"
,
"error"
,
err
)
continue
}
if
_
,
ok
:=
ggml
.
KV
()[
fmt
.
Sprintf
(
"%s.pooling_type"
,
ggml
.
KV
()
.
Architecture
())];
ok
{
return
false
}
default
:
...
...
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