Gallery repository (#663)

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2023-06-24 08:18:17 +02:00 committed by GitHub
parent 2a45a99737
commit 60db5957d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 644 additions and 194 deletions

View file

@ -4,6 +4,7 @@ import (
"context"
"embed"
"github.com/go-skynet/LocalAI/pkg/gallery"
model "github.com/go-skynet/LocalAI/pkg/model"
)
@ -21,6 +22,8 @@ type Option struct {
preloadModelsFromPath string
corsAllowOrigins string
galleries []gallery.Gallery
backendAssets embed.FS
assetsDestination string
}
@ -66,6 +69,12 @@ func WithBackendAssets(f embed.FS) AppOption {
}
}
func WithGalleries(galleries []gallery.Gallery) AppOption {
return func(o *Option) {
o.galleries = append(o.galleries, galleries...)
}
}
func WithContext(ctx context.Context) AppOption {
return func(o *Option) {
o.context = ctx