| import os |
| import toml |
| from loguru import logger |
|
|
| |
| def get_default_config(): |
| return { |
| "app": { |
| "max_concurrent_tasks": 1, |
| "api_enabled": True, |
| "llm_provider": "deepseek" |
| }, |
| "ui": { |
| "hide_log": False, |
| "language": "zh-CN" |
| } |
| } |
|
|
| |
| try: |
| root_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) |
| config_file = f"{root_dir}/config.toml" |
| |
| if os.path.exists(config_file): |
| _cfg = toml.load(config_file) |
| else: |
| _cfg = get_default_config() |
| except Exception: |
| _cfg = get_default_config() |
|
|
| |
| app = _cfg.get("app", {}) |
| ui = _cfg.get("ui", {}) |
| azure = _cfg.get("azure", {}) |
| siliconflow = _cfg.get("siliconflow", {}) |
|
|
| |
| project_name = "MoneyPrinterTurbo" |
| project_version = "1.2.6" |
| project_description = "AI Video Generator" |
|
|
| def save_config(): |
| """Minimal save function""" |
| pass |
|
|