syberWolf commited on
Commit
a60a771
·
1 Parent(s): b3aebd1

updates to handler again

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -7,13 +7,13 @@ class EndpointHandler:
7
  _instance = None # Singleton instance
8
  _model_loaded = False # Flag to check if the model is loaded
9
 
10
- def __new__(cls, *args, **kwargs):
11
  if not cls._instance:
12
- cls._instance = super(EndpointHandler, cls).__new__(cls, *args, **kwargs)
13
- cls._instance._model_loaded = False
14
  return cls._instance
15
 
16
  def __init__(self, model_path=""):
 
17
  if not self._model_loaded:
18
  # Construct the model path assuming the model is in the same directory as the handler file
19
  script_dir = os.path.dirname(os.path.abspath(__file__))
 
7
  _instance = None # Singleton instance
8
  _model_loaded = False # Flag to check if the model is loaded
9
 
10
+ def __new__(cls):
11
  if not cls._instance:
12
+ cls._instance = super(EndpointHandler, cls).__new__(cls)
 
13
  return cls._instance
14
 
15
  def __init__(self, model_path=""):
16
+ if not self._model_loaded:
17
  if not self._model_loaded:
18
  # Construct the model path assuming the model is in the same directory as the handler file
19
  script_dir = os.path.dirname(os.path.abspath(__file__))