mirror of
https://github.com/Sygil-Dev/sygil-webui.git
synced 2024-12-15 06:21:34 +03:00
fix endless sleep with optimized and batchsize (#384)
currently will endless loop in the while: time.sleep(1) part on 2nd iteration of for loop. move back to cpu should only be ran once afterwards not [batchsize] times. Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
This commit is contained in:
parent
c00233220e
commit
fe746ce7c1
10
webui.py
10
webui.py
@ -901,11 +901,11 @@ skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoisin
|
||||
if simple_templating:
|
||||
grid_captions.append( captions[i] )
|
||||
|
||||
if opt.optimized:
|
||||
mem = torch.cuda.memory_allocated()/1e6
|
||||
modelFS.to("cpu")
|
||||
while(torch.cuda.memory_allocated()/1e6 >= mem):
|
||||
time.sleep(1)
|
||||
if opt.optimized:
|
||||
mem = torch.cuda.memory_allocated()/1e6
|
||||
modelFS.to("cpu")
|
||||
while(torch.cuda.memory_allocated()/1e6 >= mem):
|
||||
time.sleep(1)
|
||||
|
||||
if (prompt_matrix or not skip_grid) and not do_not_save_grid:
|
||||
if prompt_matrix:
|
||||
|
Loading…
Reference in New Issue
Block a user