Use Python 3.9 syntax in tests (#37343)
Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# coding=utf-8
|
||||
# Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -16,7 +15,6 @@
|
||||
"""Testing suite for the PyTorch PhiMoE model."""
|
||||
|
||||
import unittest
|
||||
from typing import List
|
||||
|
||||
from parameterized import parameterized
|
||||
|
||||
@@ -70,7 +68,7 @@ if is_torch_available():
|
||||
).logits
|
||||
|
||||
@staticmethod
|
||||
def generate(model: PhimoeForCausalLM, prompt_tokens: torch.LongTensor, max_seq_len: int) -> List[int]:
|
||||
def generate(model: PhimoeForCausalLM, prompt_tokens: torch.LongTensor, max_seq_len: int) -> list[int]:
|
||||
model = PhimoeMiniWithStaticCache(model, 1, max_seq_len + prompt_tokens.shape[-1])
|
||||
|
||||
response_tokens = []
|
||||
|
||||
Reference in New Issue
Block a user