diff --git a/genai-perf/genai_perf/checkpoint/checkpoint.py b/genai-perf/genai_perf/checkpoint/checkpoint.py index be01d043..b0568d47 100644 --- a/genai-perf/genai_perf/checkpoint/checkpoint.py +++ b/genai-perf/genai_perf/checkpoint/checkpoint.py @@ -19,6 +19,7 @@ from genai_perf.config.input.config_command import ConfigCommand from genai_perf.config.run.results import Results from genai_perf.exceptions import GenAIPerfException +from genai_perf.types import CheckpointObject @dataclass(frozen=True) @@ -60,10 +61,12 @@ def _read_from_checkpoint(self) -> None: try: with open(checkpoint_filename, "r") as checkpoint_file: checkpoint_json = json.load(checkpoint_file) - self._state = {} - self._state["Results"] = Results.read_from_checkpoint( - checkpoint_json["Results"] - ) + self._state: CheckpointObject = { + "Results": Results.read_from_checkpoint( + checkpoint_json["Results"] + ) + } + except EOFError: raise ( GenAIPerfException(