initial commit

This commit is contained in:
Meshcheryakov Ilya
2024-04-16 00:54:35 +03:00
parent 7ba356efc9
commit 6859920848
4 changed files with 35 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
import json
import os
import gc
import torch
from collections import deque
from pathlib import Path
from random import random
@@ -915,7 +917,12 @@ class ModelRequestProcessor(object):
for k in list(self._engine_processor_lookup.keys()):
if k not in self._endpoints:
# atomic
self._engine_processor_lookup[k]._model = None
self._engine_processor_lookup[k]._preprocess = None
del self._engine_processor_lookup[k]
self._engine_processor_lookup.pop(k, None)
gc.collect()
torch.cuda.empty_cache()
cleanup = False
model_monitor_update = False
except Exception as ex: