added batch fix

This commit is contained in:
nicole pardal
2025-11-21 16:29:56 -08:00
parent 47e272c35a
commit cee4922649

View File

@@ -170,6 +170,11 @@ func NewLlamaServer(systemInfo ml.SystemInfo, gpus []ml.DeviceInfo, modelPath st
opts.NumBatch = min(opts.NumBatch, opts.NumCtx)
if f.KV().Architecture() == "nomic-bert" {
opts.NumBatch = opts.NumCtx
slog.Debug("nomic-bert model detected, setting batch size equal to context length", "num_batch", opts.NumBatch, "num_ctx", opts.NumCtx)
}
loadRequest := LoadRequest{LoraPath: adapters, KvSize: opts.NumCtx * numParallel, BatchSize: opts.NumBatch, Parallel: numParallel, MultiUserCache: envconfig.MultiUserCache()}
defaultThreads := systemInfo.ThreadCount