Merge branch 'ai/refactor/resource-cleanup' into 'ai/develop'

Feat: GET요청 시 Slack 메세지 제거

See merge request s11-s-project/S11P21S002!285
This commit is contained in:
김용수 2024-10-04 14:47:40 +09:00
commit 4afe688f58

View File

@ -28,10 +28,8 @@ async def resource_cleaner_middleware(request: Request, call_next):
raise exc
finally:
process_time = time.time() - start_time
if request.method != "GET":
send_slack_message(f"처리 시간: {process_time}")
for obj in gc.get_objects():
if torch.is_tensor(obj):
del obj
gc.collect()
torch.cuda.empty_cache()
return response