fix: use context manager syntax compatible with python 3.8

parentheses supported in python 3.10
pull/1/head
Bryce 2 years ago
parent 51a8b1b8d8
commit fa3673ef56

@ -171,7 +171,7 @@ def imagine(
if precision == "autocast" and get_device() in ("cuda", "cpu")
else nullcontext
)
with (torch.no_grad(), precision_scope(get_device()), fix_torch_nn_layer_norm()):
with torch.no_grad(), precision_scope(get_device()), fix_torch_nn_layer_norm():
for prompt in prompts:
with LatentLoggingContext(
prompt=prompt, model=model, img_callback=img_callback

Loading…
Cancel
Save