File size: 589 Bytes
df6cf36 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import json
import os
class EnvLoader:
def __init__(self, config_path="env.json"):
self.config_path = config_path
self.config = self._load()
def _load(self):
default_config = {
"max_memory_mb": 2048,
"d_model": 256,
"ledger_path": "storage/ledger.bin",
"log_level": "DEBUG"
}
if os.path.exists(self.config_path):
with open(self.config_path, "r") as f:
return json.load(f)
return default_config
def get(self, key):
return self.config.get(key)
|