mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-11-01 14:23:32 +00:00
Allow to set a SetLibrarySearchPath in the golang bindings (#981)
This is used to identify the path where all the various implementations are
This commit is contained in:
committed by
GitHub
parent
8953b7f6a6
commit
b004c53a7b
@@ -10,6 +10,7 @@ package gpt4all
|
||||
// float top_p, float temp, int n_batch,float ctx_erase);
|
||||
// void free_model(void *state_ptr);
|
||||
// extern unsigned char getTokenCallback(void *, char *);
|
||||
// void llmodel_set_implementation_search_path(const char *path);
|
||||
import "C"
|
||||
import (
|
||||
"fmt"
|
||||
@@ -27,6 +28,10 @@ type Model struct {
|
||||
func New(model string, opts ...ModelOption) (*Model, error) {
|
||||
ops := NewModelOptions(opts...)
|
||||
|
||||
if ops.LibrarySearchPath != "" {
|
||||
C.llmodel_set_implementation_search_path(C.CString(ops.LibrarySearchPath))
|
||||
}
|
||||
|
||||
state := C.load_model(C.CString(model), C.int(ops.Threads))
|
||||
|
||||
if state == nil {
|
||||
|
||||
Reference in New Issue
Block a user