mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-20 16:00:17 +00:00
feat: allow to preload models before startup via env var or configs (#391)
This commit is contained in:
committed by
GitHub
parent
835a20610b
commit
76c881043e
@ -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
|
||||
|
Reference in New Issue
Block a user