Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -20,6 +20,8 @@ def inference(image, size):
|
|
20 |
result = model4.predict(image.convert('RGB'))
|
21 |
else:
|
22 |
result = model8.predict(image.convert('RGB'))
|
|
|
|
|
23 |
return result
|
24 |
|
25 |
|
|
|
20 |
result = model4.predict(image.convert('RGB'))
|
21 |
else:
|
22 |
result = model8.predict(image.convert('RGB'))
|
23 |
+
if torch.cuda.is_available():
|
24 |
+
torch.cuda.empty_cache()
|
25 |
return result
|
26 |
|
27 |
|