18 lines
484 B
Python
18 lines
484 B
Python
from llm_server.config.model import ConfigModel
|
|
|
|
|
|
class GlobalConfig:
|
|
__config_model: ConfigModel = None
|
|
|
|
@classmethod
|
|
def initalize(cls, config: ConfigModel):
|
|
if cls.__config_model is not None:
|
|
raise Exception('Config is already initialised')
|
|
cls.__config_model = config
|
|
|
|
@classmethod
|
|
def get(cls):
|
|
if cls.__config_model is None:
|
|
raise Exception('Config has not been initialised')
|
|
return cls.__config_model
|