implement loading ggml lora adapters through the modelfile

This commit is contained in:
Michael Yang
2023-08-03 17:16:05 -07:00
parent d791df75dd
commit 6de5d032e1
5 changed files with 65 additions and 13 deletions

View File

@ -19,7 +19,7 @@ type LLM interface {
Close()
}
func New(model string, opts api.Options) (LLM, error) {
func New(model string, adapters []string, opts api.Options) (LLM, error) {
if _, err := os.Stat(model); err != nil {
return nil, err
}
@ -66,7 +66,7 @@ func New(model string, opts api.Options) (LLM, error) {
switch ggml.ModelFamily {
case ModelFamilyLlama:
return newLlama(model, opts)
return newLlama(model, adapters, opts)
default:
return nil, fmt.Errorf("unknown ggml type: %s", ggml.ModelFamily)
}