mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
refactor: Minor improvements to BackendConfigLoader (#2353)
some minor renames and refactorings within BackendConfigLoader - make things more consistent, remove underused code, rename things for clarity Signed-off-by: Dave Lee <dave@gray101.com>
This commit is contained in:
parent
114f549f5e
commit
0b637465d9
5 changed files with 117 additions and 116 deletions
|
@ -360,8 +360,14 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
|
|||
}
|
||||
|
||||
func (c *BackendConfig) Validate() bool {
|
||||
downloadedFileNames := []string{}
|
||||
for _, f := range c.DownloadFiles {
|
||||
downloadedFileNames = append(downloadedFileNames, f.Filename)
|
||||
}
|
||||
validationTargets := []string{c.Backend, c.Model, c.MMProj}
|
||||
validationTargets = append(validationTargets, downloadedFileNames...)
|
||||
// Simple validation to make sure the model can be correctly loaded
|
||||
for _, n := range []string{c.Backend, c.Model, c.MMProj} {
|
||||
for _, n := range validationTargets {
|
||||
if n == "" {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue