Spaces:
Runtime error
Runtime error
After generating the images, clear the GPU cache
Browse files
app.py
CHANGED
|
@@ -217,8 +217,10 @@ def generate(
|
|
| 217 |
with open(f"{filename}.txt", "w") as f:
|
| 218 |
f.write(prompt)
|
| 219 |
|
| 220 |
-
|
|
|
|
| 221 |
|
|
|
|
| 222 |
|
| 223 |
|
| 224 |
|
|
|
|
| 217 |
with open(f"{filename}.txt", "w") as f:
|
| 218 |
f.write(prompt)
|
| 219 |
|
| 220 |
+
# After generating the images, clear the GPU cache
|
| 221 |
+
torch.cuda.empty_cache()
|
| 222 |
|
| 223 |
+
return output_images # return the list of image objects
|
| 224 |
|
| 225 |
|
| 226 |
|