Detect and recover if runner removed
Tmp cleaners can nuke the file out from underneath us. This detects the missing runner, and re-initializes the payloads.
This commit is contained in:
parent
cc5a71e0e3
commit
58888a74bc
1 changed files with 11 additions and 0 deletions
|
@ -250,6 +250,17 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
|
||||||
server = server + ".exe"
|
server = server + ".exe"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Detect tmp cleaners wiping out the file
|
||||||
|
_, err := os.Stat(server)
|
||||||
|
if errors.Is(err, os.ErrNotExist) {
|
||||||
|
slog.Warn("llama server disappeared, reinitializing payloads", "path", server, "error", err)
|
||||||
|
err = Init()
|
||||||
|
if err != nil {
|
||||||
|
slog.Warn("failed to reinitialize payloads", "error", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s := &llmServer{
|
s := &llmServer{
|
||||||
port: port,
|
port: port,
|
||||||
cmd: exec.Command(server, finalParams...),
|
cmd: exec.Command(server, finalParams...),
|
||||||
|
|
Loading…
Reference in a new issue