From b49721cdd1dc66a57919564843cd32cdb4be1d3f Mon Sep 17 00:00:00 2001 From: mudler Date: Fri, 5 May 2023 18:05:10 +0200 Subject: [PATCH] fix: respect config from file for backends settings --- api/openai.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/api/openai.go b/api/openai.go index 39212e6..6061e35 100644 --- a/api/openai.go +++ b/api/openai.go @@ -262,6 +262,10 @@ func readConfig(cm ConfigMerger, c *fiber.Ctx, loader *model.ModelLoader, debug if !exists { config = &Config{ OpenAIRequest: defaultRequest(modelFile), + ContextSize: ctx, + Threads: threads, + F16: f16, + Debug: debug, } } else { 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 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 }