def flatten_past_kv_inputs(self, past_key_values: list[tuple[torch.Tensor, torch.Tensor]]):
        """Flatten past_key_values to a dict of past_key and past_value. For ONNX model only."""
        past_kv = {}
        # Convert list of past_kv to dict of past_key and past_value
        for i, (past_k, past_v) in enumerate(past_key_values):
            past_kv[self.ort_past_key_name.replace("<id>", str(i))] = past_k
            past_kv[self.ort_past_value_name.replace("<id>", str(i))] = past_v
        return past_kv
Flatten past_key_values to a dict of past_key and past_value. For ONNX model only.
olive/data/component/dataset.py