mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-25 21:15:00 +00:00
fix(embed): use go-rice for large backend assets
Golang embed FS has a hard limit that we might exceed when providing many binary alternatives. Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
72111c597d
commit
8d0419d3d1
12 changed files with 90 additions and 53 deletions
|
@ -2,11 +2,11 @@ package config
|
|||
|
||||
import (
|
||||
"context"
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"regexp"
|
||||
"time"
|
||||
|
||||
rice "github.com/GeertJohan/go.rice"
|
||||
"github.com/mudler/LocalAI/pkg/xsysinfo"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
@ -47,7 +47,7 @@ type ApplicationConfig struct {
|
|||
|
||||
Galleries []Gallery
|
||||
|
||||
BackendAssets embed.FS
|
||||
BackendAssets *rice.Box
|
||||
AssetsDestination string
|
||||
|
||||
ExternalGRPCBackends map[string]string
|
||||
|
@ -198,7 +198,7 @@ func WithBackendAssetsOutput(out string) AppOption {
|
|||
}
|
||||
}
|
||||
|
||||
func WithBackendAssets(f embed.FS) AppOption {
|
||||
func WithBackendAssets(f *rice.Box) AppOption {
|
||||
return func(o *ApplicationConfig) {
|
||||
o.BackendAssets = f
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue