mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
feat: allow to preload models before startup via env var or configs (#391)
This commit is contained in:
parent
835a20610b
commit
76c881043e
4 changed files with 112 additions and 38 deletions
|
@ -15,6 +15,8 @@ type Option struct {
|
|||
debug, disableMessage bool
|
||||
imageDir string
|
||||
cors bool
|
||||
preloadJSONModels string
|
||||
preloadModelsFromPath string
|
||||
corsAllowOrigins string
|
||||
}
|
||||
|
||||
|
@ -53,6 +55,17 @@ func WithContext(ctx context.Context) AppOption {
|
|||
}
|
||||
}
|
||||
|
||||
func WithYAMLConfigPreload(configFile string) AppOption {
|
||||
return func(o *Option) {
|
||||
o.preloadModelsFromPath = configFile
|
||||
}
|
||||
}
|
||||
|
||||
func WithJSONStringPreload(configFile string) AppOption {
|
||||
return func(o *Option) {
|
||||
o.preloadJSONModels = configFile
|
||||
}
|
||||
}
|
||||
func WithConfigFile(configFile string) AppOption {
|
||||
return func(o *Option) {
|
||||
o.configFile = configFile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue