示例#1
0
 def serialize(self, path: Path) -> None:
     try:
         # serialize Predictor type
         with (path / 'type.txt').open('w') as fp:
             fp.write(fqname_for(self.__class__))
     except Exception as e:
         raise IOError(
             f'Cannot serialize {fqname_for(self.__class__)}') from e
示例#2
0
 def serialize(self, path: Path) -> None:
     # serialize Predictor type
     with (path / "type.txt").open("w") as fp:
         fp.write(fqname_for(self.__class__))
     with (path / "version.json").open("w") as fp:
         json.dump(
             {"model": self.__version__, "gluonts": gluonts.__version__}, fp
         )
示例#3
0
 def serialize(self, path: Path) -> None:
     try:
         # serialize Predictor type
         with (path / "type.txt").open("w") as fp:
             fp.write(fqname_for(self.__class__))
     except Exception as e:
         raise IOError(
             f"Cannot serialize {fqname_for(self.__class__)} in {path}"
         ) from e
示例#4
0
 def serialize(self, path: Path) -> None:
     # serialize Predictor type
     with (path / "type.txt").open("w") as fp:
         fp.write(fqname_for(self.__class__))