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:
Ettore Di Giacinto
2023-06-14 16:27:19 +02:00
committed by GitHub
parent 8953b7f6a6
commit b004c53a7b
3 changed files with 15 additions and 2 deletions

View File

@@ -24,7 +24,8 @@ var DefaultModelOptions ModelOptions = ModelOptions{
}
type ModelOptions struct {
Threads int
Threads int
LibrarySearchPath string
}
type ModelOption func(p *ModelOptions)
@@ -100,6 +101,13 @@ func SetThreads(c int) ModelOption {
}
}
// SetLibrarySearchPath sets the dynamic libraries used by gpt4all for the various ggml implementations.
func SetLibrarySearchPath(t string) ModelOption {
return func(p *ModelOptions) {
p.LibrarySearchPath = t
}
}
// Create a new PredictOptions object with the given options.
func NewModelOptions(opts ...ModelOption) ModelOptions {
p := DefaultModelOptions