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:
commit
4afe688f58
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user