Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
3bb646a5
Unverified
Commit
3bb646a5
authored
Aug 05, 2024
by
Raushan Turganbay
Committed by
GitHub
Aug 05, 2024
Browse files
Phi3 tests: fix typing for Python 3.8 (#32388)
fix phi
parent
05ae3a30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tests/models/phi3/test_modeling_phi3.py
tests/models/phi3/test_modeling_phi3.py
+2
-1
No files found.
tests/models/phi3/test_modeling_phi3.py
View file @
3bb646a5
...
...
@@ -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
)
->
l
ist
[
int
]:
def
generate
(
model
:
Phi3ForCausalLM
,
prompt_tokens
:
torch
.
LongTensor
,
max_seq_len
:
int
)
->
L
ist
[
int
]:
model
=
Phi3MiniWithStaticCache
(
model
,
1
,
max_seq_len
+
prompt_tokens
.
shape
[
-
1
])
response_tokens
=
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment