mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-25 04:54:59 +00:00
fix: security scanner warning noise: error handlers part 1 (#2141)
first group of error handlers to reduce security scanner warning noise level Signed-off-by: Dave Lee <dave@gray101.com>
This commit is contained in:
parent
44bc540bb5
commit
2cd4936c99
7 changed files with 34 additions and 10 deletions
|
@ -7,7 +7,8 @@ import (
|
|||
|
||||
"github.com/go-skynet/LocalAI/core/config"
|
||||
pb "github.com/go-skynet/LocalAI/pkg/grpc/proto"
|
||||
model "github.com/go-skynet/LocalAI/pkg/model"
|
||||
"github.com/go-skynet/LocalAI/pkg/model"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func modelOpts(c config.BackendConfig, so *config.ApplicationConfig, opts []model.Option) []model.Option {
|
||||
|
@ -109,8 +110,12 @@ func gRPCPredictOpts(c config.BackendConfig, modelPath string) *pb.PredictOption
|
|||
promptCachePath := ""
|
||||
if c.PromptCachePath != "" {
|
||||
p := filepath.Join(modelPath, c.PromptCachePath)
|
||||
os.MkdirAll(filepath.Dir(p), 0750)
|
||||
promptCachePath = p
|
||||
err := os.MkdirAll(filepath.Dir(p), 0750)
|
||||
if err == nil {
|
||||
promptCachePath = p
|
||||
} else {
|
||||
log.Error().Err(err).Str("promptCachePath", promptCachePath).Msg("error creating prompt cache folder")
|
||||
}
|
||||
}
|
||||
|
||||
return &pb.PredictOptions{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue