Skip to content

Commit 6488bb4

Browse files
tjohnson31415njhill
authored andcommitted
integration_tests: add some tests with gpt2
Signed-off-by: Travis Johnson <[email protected]>
1 parent 0103d69 commit 6488bb4

File tree

2 files changed

+122
-0
lines changed

2 files changed

+122
-0
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Test empty requests
2+
- name: Empty
3+
request: {}
4+
response: {}
5+
6+
7+
# Basic Greedy (implicit)
8+
- name: Basic Greedy, max new tokens (implicit)
9+
request:
10+
requests:
11+
- {"text": "A very long story:\n"}
12+
response:
13+
responses:
14+
- generatedTokenCount: 20
15+
inputTokenCount: 6
16+
stopReason: MAX_TOKENS
17+
text: '
18+
19+
The first time I saw the movie, I was in the middle of a movie with my wife'
20+
21+
22+
# Basic Greedy (explicit)
23+
- name: Basic Greedy, max new tokens (explicit)
24+
request:
25+
params:
26+
method: GREEDY
27+
stopping: {"maxNewTokens": 20}
28+
requests:
29+
- {"text": "A very long story:\n"}
30+
response:
31+
responses:
32+
- generatedTokenCount: 20
33+
inputTokenCount: 6
34+
stopReason: MAX_TOKENS
35+
text: '
36+
37+
The first time I saw the movie, I was in the middle of a movie with my wife'
38+
39+
40+
# Multiple inputs with token info
41+
- name: Multiple inputs with token info
42+
request:
43+
params:
44+
method: GREEDY
45+
stopping: {"maxNewTokens": 2}
46+
response:
47+
generatedTokens: true
48+
tokenLogprobs: true
49+
topNTokens: 2
50+
requests:
51+
- {"text": "A very long story:\n"}
52+
- {"text": "I am a "}
53+
- {"text": "Hello, "}
54+
response:
55+
responses:
56+
- generatedTokenCount: 2
57+
inputTokenCount: 6
58+
stopReason: MAX_TOKENS
59+
text: '
60+
61+
The'
62+
tokens:
63+
- logprob: -0.03937243
64+
text: "\u010A"
65+
topTokens:
66+
- logprob: -0.03937243
67+
text: "\u010A"
68+
- logprob: -5.819852
69+
text: The
70+
- logprob: -2.627593
71+
text: The
72+
topTokens:
73+
- logprob: -2.627593
74+
text: The
75+
- logprob: -2.828246
76+
text: I
77+
- generatedTokenCount: 2
78+
inputTokenCount: 4
79+
stopReason: MAX_TOKENS
80+
text: "\_young"
81+
tokens:
82+
- logprob: -2.2894902
83+
text: "\xC2\u0142"
84+
topTokens:
85+
- logprob: -2.2894902
86+
text: "\xC2\u0142"
87+
- logprob: -2.3675122
88+
text: _____
89+
- logprob: -3.8699257
90+
text: young
91+
topTokens:
92+
- logprob: -3.8699257
93+
text: young
94+
- logprob: -4.3716497
95+
text: professional
96+
- generatedTokenCount: 2
97+
inputTokenCount: 3
98+
stopReason: MAX_TOKENS
99+
text: "\_I"
100+
tokens:
101+
- logprob: -1.7967854
102+
text: "\xC2\u0142"
103+
topTokens:
104+
- logprob: -1.7967854
105+
text: "\xC2\u0142"
106+
- logprob: -2.579813
107+
text: '!!!'
108+
- logprob: -1.3872381
109+
text: I
110+
topTokens:
111+
- logprob: -1.3872381
112+
text: I
113+
- logprob: -2.9594731
114+
text: you

integration_tests/text_generation_tests/test_server.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,14 @@ async def _test_multi_input_seeds(stub):
311311
assert 0 <= seed <= 4294967295
312312

313313

314+
@pytest.mark.model("gpt2")
315+
@pytest.mark.extensions(".safetensors,.json")
316+
@pytest.mark.shards(1)
317+
@pytest.mark.test_case_file("test_cases_gpt2.yaml")
318+
@pytest.mark.asyncio
319+
async def test_gpt2(server_fixture, test_cases):
320+
await run_test_cases_async(test_cases)
321+
314322
@pytest.mark.model("bigscience/bloom-560m")
315323
@pytest.mark.extensions(".safetensors,.json,.model")
316324
@pytest.mark.shards(1)

0 commit comments

Comments
 (0)