mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-15 13:38:07 +00:00
feat: bert.cpp token embeddings (#241)
This commit is contained in:
committed by
GitHub
parent
b4241d0a0d
commit
2488c445b6
@ -68,7 +68,7 @@ func ModelEmbedding(s string, tokens []int, loader *model.ModelLoader, c Config)
|
||||
case *bert.Bert:
|
||||
fn = func() ([]float32, error) {
|
||||
if len(tokens) > 0 {
|
||||
return nil, fmt.Errorf("embeddings endpoint for this model supports only string")
|
||||
return model.TokenEmbeddings(tokens, bert.SetThreads(c.Threads))
|
||||
}
|
||||
return model.Embeddings(s, bert.SetThreads(c.Threads))
|
||||
}
|
||||
|
Reference in New Issue
Block a user