Skip to content

Commit

Permalink
Phi3 tests: fix typing for Python 3.8 (#32388)
Browse files Browse the repository at this point in the history
fix phi
  • Loading branch information
zucchini-nlp authored and nbroad1881 committed Aug 7, 2024
1 parent 1017316 commit 3d581de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/models/phi3/test_modeling_phi3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""Testing suite for the PyTorch Phi-3 model."""

import unittest
from typing import List

from parameterized import parameterized

Expand Down Expand Up @@ -69,7 +70,7 @@ def forward(
).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 = []
Expand Down

0 comments on commit 3d581de

Please sign in to comment.