From 39498973aa365564644abc4b1eabf863e958bfd5 Mon Sep 17 00:00:00 2001 From: braf Date: Wed, 16 Oct 2024 16:49:34 +0000 Subject: [PATCH] Minor typing cleanup --- genai-perf/genai_perf/checkpoint/checkpoint.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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(