thunnai commited on
Commit
7694e6f
·
1 Parent(s): a223259

Optimize GPU device handling in generate function

Browse files

- Simplify model device transfer method
- Remove redundant `.to("cuda")` assignment
- Ensure model is correctly moved to GPU when available

Files changed (1) hide show
  1. webui.py +1 -1
webui.py CHANGED
@@ -59,7 +59,7 @@ def generate(text,
59
 
60
  # if gpu available, move model to gpu
61
  if torch.cuda.is_available():
62
- model = model.to("cuda")
63
 
64
  with torch.no_grad():
65
  wav = model.inference(
 
59
 
60
  # if gpu available, move model to gpu
61
  if torch.cuda.is_available():
62
+ model.to("cuda")
63
 
64
  with torch.no_grad():
65
  wav = model.inference(