log embedding eval timing

This commit is contained in:
Bruce MacDonald 2023-08-14 12:15:55 -04:00 committed by GitHub
commit 2ab20095b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -471,6 +471,8 @@ func (llm *llama) Embedding(input string) ([]float64, error) {
return nil, errors.New("llama: eval") return nil, errors.New("llama: eval")
} }
C.llama_print_timings(llm.ctx)
n := C.llama_n_embd(llm.ctx) n := C.llama_n_embd(llm.ctx)
if n <= 0 { if n <= 0 {
return nil, errors.New("llama: no embeddings generated") return nil, errors.New("llama: no embeddings generated")