mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 03:01:07 +06:00
parent
05ae3a300d
commit
3bb646a54f
@ -16,6 +16,7 @@
|
|||||||
"""Testing suite for the PyTorch Phi-3 model."""
|
"""Testing suite for the PyTorch Phi-3 model."""
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
from typing import List
|
||||||
|
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
|
|
||||||
@ -69,7 +70,7 @@ if is_torch_available():
|
|||||||
).logits
|
).logits
|
||||||
|
|
||||||
@staticmethod
|
@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])
|
model = Phi3MiniWithStaticCache(model, 1, max_seq_len + prompt_tokens.shape[-1])
|
||||||
|
|
||||||
response_tokens = []
|
response_tokens = []
|
||||||
|
Loading…
Reference in New Issue
Block a user