Files
modelscope/maas_lib/fileio/format/base.py
wenmeng.zwm 0a756f6a0d [to #41402703] add basic modules
* add constant
 * add logger module
 * add registry and builder module
 * add fileio module
 * add requirements and setup.cfg
 * add config module and tests
 * add citest script

Link: https://code.aone.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/8718998
2022-05-17 10:15:00 +08:00

21 lines
454 B
Python

# Copyright (c) Alibaba, Inc. and its affiliates.
from abc import ABCMeta, abstractmethod
class FormatHandler(metaclass=ABCMeta):
# if `text_format` is True, file
# should use text mode otherwise binary mode
text_mode = True
@abstractmethod
def load(self, file, **kwargs):
pass
@abstractmethod
def dump(self, obj, file, **kwargs):
pass
@abstractmethod
def dumps(self, obj, **kwargs):
pass