(cls, *args, **kwargs)
| 6 | |
| 7 | # ensure predictor be initialized only once by using Singleton Pattern |
| 8 | def __new__(cls, *args, **kwargs): |
| 9 | if not hasattr(cls, '__instance'): |
| 10 | cls.__instance = super().__new__(cls) |
| 11 | cls.__model = load_model('app/models/regression.h5') |
| 12 | return cls.__instance |
| 13 | |
| 14 | @staticmethod |
| 15 | def predict(input_data): |