Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -410,7 +410,7 @@ def generate_30(
|
|
410 |
del model5
|
411 |
del processor5
|
412 |
gc.collect()
|
413 |
-
torch.cuda.
|
414 |
expand_prompt(prompt)
|
415 |
expand_prompt(caption)
|
416 |
expanded = expand_prompt(caption_2)
|
@@ -421,7 +421,7 @@ def generate_30(
|
|
421 |
del model
|
422 |
del txt_tokenizer
|
423 |
gc.collect()
|
424 |
-
torch.cuda.
|
425 |
global text_encoder_1
|
426 |
global text_encoder_2
|
427 |
pipe.text_encoder=text_encoder_1.to(device=device, dtype=torch.bfloat16)
|
|
|
410 |
del model5
|
411 |
del processor5
|
412 |
gc.collect()
|
413 |
+
torch.cuda.empty_cache()
|
414 |
expand_prompt(prompt)
|
415 |
expand_prompt(caption)
|
416 |
expanded = expand_prompt(caption_2)
|
|
|
421 |
del model
|
422 |
del txt_tokenizer
|
423 |
gc.collect()
|
424 |
+
torch.cuda.empty_cache()
|
425 |
global text_encoder_1
|
426 |
global text_encoder_2
|
427 |
pipe.text_encoder=text_encoder_1.to(device=device, dtype=torch.bfloat16)
|