Reload model if num_gpu changes (#3920)

* reload model if `num_gpu` changes

* dont reload on -1

* fix tests
This commit is contained in:
Jeffrey Morgan 2024-04-25 19:02:40 -04:00 committed by GitHub
parent 993cf8bf55
commit 00b0699c75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 6 deletions

View file

@ -490,6 +490,9 @@ func TestNeedsReload(t *testing.T) {
require.False(t, resp)
req.opts.NumGPU = 99
resp = runner.needsReload(ctx, req)
require.True(t, resp)
req.opts.NumGPU = -1
resp = runner.needsReload(ctx, req)
require.False(t, resp)
}