This repository has been archived on 2024-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
2024-05-07 12:20:53 -06:00
|
|
|
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):
|
2024-05-08 22:19:57 -06:00
|
|
|
if cls.__config_model is None:
|
|
|
|
raise Exception('Config has not been initialised')
|
2024-05-07 12:20:53 -06:00
|
|
|
return cls.__config_model
|