From 3bb646a54f42030e9bafa47cd3f64367691a3bc5 Mon Sep 17 00:00:00 2001 From: Raushan Turganbay Date: Mon, 5 Aug 2024 11:58:42 +0500 Subject: [PATCH] Phi3 tests: fix typing for Python 3.8 (#32388) fix phi --- tests/models/phi3/test_modeling_phi3.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/models/phi3/test_modeling_phi3.py b/tests/models/phi3/test_modeling_phi3.py index ec3986ff23..eb113a4df6 100644 --- a/tests/models/phi3/test_modeling_phi3.py +++ b/tests/models/phi3/test_modeling_phi3.py @@ -16,6 +16,7 @@ """Testing suite for the PyTorch Phi-3 model.""" import unittest +from typing import List from parameterized import parameterized @@ -69,7 +70,7 @@ if is_torch_available(): ).logits @staticmethod - def generate(model: Phi3ForCausalLM, prompt_tokens: torch.LongTensor, max_seq_len: int) -> list[int]: + def generate(model: Phi3ForCausalLM, prompt_tokens: torch.LongTensor, max_seq_len: int) -> List[int]: model = Phi3MiniWithStaticCache(model, 1, max_seq_len + prompt_tokens.shape[-1]) response_tokens = []