fix(seed): generate random seed per-request if -1 is set (#1952)

* fix(seed): generate random seed per-request if -1 is set

Also update ci with new workflows and allow the aio tests to run with an
api key

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* docs(openvino): Add OpenVINO example

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-04-03 22:25:47 +02:00 committed by GitHub
parent 93cfec3c32
commit ff77d3bc22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 110 additions and 7 deletions

View file

@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"io/fs"
"math/rand"
"os"
"path/filepath"
"sort"
@ -20,6 +19,10 @@ import (
"github.com/charmbracelet/glamour"
)
const (
RAND_SEED = -1
)
type BackendConfig struct {
schema.PredictionOptions `yaml:"parameters"`
Name string `yaml:"name"`
@ -218,7 +221,7 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
if cfg.Seed == nil {
// random number generator seed
defaultSeed := int(rand.Int31())
defaultSeed := RAND_SEED
cfg.Seed = &defaultSeed
}