Merge pull request #112 from sennnnn/diffusion_deepspeed_fix

🐛 [BUG] Add base config for Latte

Former-commit-id: 825aa78ded6a5436d53d488b2c2250ac41b2bff9
This commit is contained in:
lb203
2024-03-10 15:29:50 +08:00
committed by GitHub
@@ -0,0 +1,24 @@
import json
"""
We are currently working on the abstraction of the code structure,
so there is no content here for the moment.
It will be gradually optimized over time.
Contributions from the open-source community are welcome.
"""
class BaseConfiguration:
def __init__(self, **kwargs):
pass
def to_json_string(self):
json_string = json.dumps(vars(self))
return json_string
def to_dict(self):
return vars(self)
@classmethod
def load_from_file(cls, config_path):
with open(config_path, 'r') as json_file:
config_dict = json.load(json_file)
return cls(**config_dict)