You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

base.py 454 B

1234567891011121314151617181920
  1. # Copyright (c) Alibaba, Inc. and its affiliates.
  2. from abc import ABCMeta, abstractmethod
  3. class FormatHandler(metaclass=ABCMeta):
  4. # if `text_format` is True, file
  5. # should use text mode otherwise binary mode
  6. text_mode = True
  7. @abstractmethod
  8. def load(self, file, **kwargs):
  9. pass
  10. @abstractmethod
  11. def dump(self, obj, file, **kwargs):
  12. pass
  13. @abstractmethod
  14. def dumps(self, obj, **kwargs):
  15. pass

致力于通过开放的社区合作,开源AI模型以及相关创新技术,推动基于模型即服务的生态繁荣发展