chore: simplify model loading (#3715)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-10-02 08:59:06 +02:00 committed by GitHub
parent 5488fc3bc1
commit 3acd767ac4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,17 +11,11 @@ func ModelTokenize(s string, loader *model.ModelLoader, backendConfig config.Bac
modelFile := backendConfig.Model
grpcOpts := GRPCModelOpts(backendConfig)
var inferenceModel grpc.Backend
var err error
opts := modelOpts(backendConfig, appConfig, []model.Option{
model.WithLoadGRPCLoadModelOpts(grpcOpts),
model.WithThreads(uint32(*backendConfig.Threads)),
model.WithAssetDir(appConfig.AssetsDestination),
opts := ModelOptions(backendConfig, appConfig, []model.Option{
model.WithModel(modelFile),
model.WithContext(appConfig.Context),
})
if backendConfig.Backend == "" {