Skip to content

Commit

Permalink
Puller interface implementation for Ollama provider
Browse files Browse the repository at this point in the history
Part of #283
  • Loading branch information
Munsio committed Jul 25, 2024
1 parent 98aeb3b commit e31f76e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions provider/ollama/ollama.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,8 @@ func (p *Provider) Load(modelIdentifier string) error {
func (p *Provider) Unload(modelIdentifier string) error {
return tools.OllamaUnload(p.url, strings.TrimPrefix(modelIdentifier, p.ID()+provider.ProviderModelSeparator))
}

// Pull downloads the given model.
func (p *Provider) Pull(logger *log.Logger, modelIdentifier string) error {
return tools.OllamaPull(logger, p.binaryPath, p.url, strings.TrimPrefix(modelIdentifier, p.ID()+provider.ProviderModelSeparator))
}
2 changes: 1 addition & 1 deletion provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ type Loader interface {
// Puller is a provider that is capable of pulling models.
type Puller interface {
// Pull downloads the given model.
Pull(logger *log.Logger, modelIdentifier string) error
Pull(logger *log.Logger, modelIdentifier string) (err error)
}

0 comments on commit e31f76e

Please sign in to comment.