Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
Update image_query_classification.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jonafeucht committed Jun 12, 2024
1 parent a402a25 commit 629fa39
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/routes/api/image_query_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,14 @@ async def multi_image_query_classification(
)
finally:
img.close()
del classifier
torch.cuda.empty_cache()

except Exception as e:
print("File is not a valid image.")
img.close()
return {"error": str(e)}

finally:
del classifier
torch.cuda.empty_cache()

totalResults.append({index: image_list})

return totalResults

0 comments on commit 629fa39

Please sign in to comment.