Merge pull request #4736 from ollama/mxyng/vocab-only

vocab only for tokenize
This commit is contained in:
Michael Yang 2024-05-30 17:21:00 -07:00 committed by GitHub
commit eb2c443a79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,11 +47,11 @@ func newLlamaModel(p string) *llamaModel {
cs := C.CString(p) cs := C.CString(p)
defer C.free(unsafe.Pointer(cs)) defer C.free(unsafe.Pointer(cs))
params := C.llama_model_default_params()
params.vocab_only = true
return &llamaModel{ return &llamaModel{
C.llama_load_model_from_file( C.llama_load_model_from_file(cs, params),
cs,
C.llama_model_default_params(),
),
} }
} }