| 721 | |
| 722 | |
| 723 | def deserialize( |
| 724 | artifact: export_serialize.SerializedArtifact, |
| 725 | ) -> ep.ExportedProgram: |
| 726 | assert isinstance(artifact.exported_program, bytes) |
| 727 | exported_program_str = artifact.exported_program.decode("utf-8") |
| 728 | exported_program_dict = json.loads(exported_program_str) |
| 729 | serialized_exported_program = export_serialize._dict_to_dataclass( |
| 730 | schema.ExportedProgram, exported_program_dict |
| 731 | ) |
| 732 | return ExportedProgramDeserializer().deserialize( |
| 733 | serialized_exported_program, |
| 734 | artifact.state_dict, |
| 735 | artifact.constants, |
| 736 | artifact.example_inputs, |
| 737 | ) |
| 738 | |
| 739 | |
| 740 | def save( |