Spaces:
Paused
Paused
Added: empty_cache (#2)
Browse files- Added: empty_cache (c86c3e08ffdbf43266c7f4d2bb294b97cc09b1e0)
Co-authored-by: Max Skobeev <[email protected]>
app.py
CHANGED
@@ -25,6 +25,9 @@ def generate_caption(image, caption_type):
|
|
25 |
|
26 |
caption = "\n".join(caption)
|
27 |
|
|
|
|
|
|
|
28 |
return caption
|
29 |
|
30 |
|
|
|
25 |
|
26 |
caption = "\n".join(caption)
|
27 |
|
28 |
+
if torch.cuda.is_available():
|
29 |
+
torch.cuda.empty_cache()
|
30 |
+
|
31 |
return caption
|
32 |
|
33 |
|