mirror of
https://github.com/mudler/LocalAI.git
synced 2025-02-07 03:29:10 +00:00
fix: respect config from file for backends settings
This commit is contained in:
parent
64c0a7967f
commit
b49721cdd1
@ -262,6 +262,10 @@ func readConfig(cm ConfigMerger, c *fiber.Ctx, loader *model.ModelLoader, debug
|
|||||||
if !exists {
|
if !exists {
|
||||||
config = &Config{
|
config = &Config{
|
||||||
OpenAIRequest: defaultRequest(modelFile),
|
OpenAIRequest: defaultRequest(modelFile),
|
||||||
|
ContextSize: ctx,
|
||||||
|
Threads: threads,
|
||||||
|
F16: f16,
|
||||||
|
Debug: debug,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
config = &cfg
|
config = &cfg
|
||||||
@ -270,20 +274,6 @@ func readConfig(cm ConfigMerger, c *fiber.Ctx, loader *model.ModelLoader, debug
|
|||||||
// Set the parameters for the language model prediction
|
// Set the parameters for the language model prediction
|
||||||
updateConfig(config, input)
|
updateConfig(config, input)
|
||||||
|
|
||||||
if threads != 0 {
|
|
||||||
config.Threads = threads
|
|
||||||
}
|
|
||||||
if ctx != 0 {
|
|
||||||
config.ContextSize = ctx
|
|
||||||
}
|
|
||||||
if f16 {
|
|
||||||
config.F16 = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if debug {
|
|
||||||
config.Debug = true
|
|
||||||
}
|
|
||||||
|
|
||||||
return config, input, nil
|
return config, input, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user