Files
hao-ai-lab-FastVideo/opensora/models/diffusion/configuration_base.py
T
sennnnn 995454b518 Add base config.
Former-commit-id: d37c551a0421d6b73dee26060b517c46d8217e4f
2024-03-10 15:24:40 +08:00

25 lines
663 B
Python

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)