Skip to content

Commit 6783a96

Browse files
tjohnson31415njhill
authored andcommitted
test: add tests for truncation with prefixes
Signed-off-by: Travis Johnson <[email protected]>
1 parent cbe805a commit 6783a96

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

integration_tests/test_cases_bloom560m.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,24 @@
5858
stopReason: EOS_TOKEN
5959
text: ' positive'
6060

61+
- name: Greedy with tuned prompt prefix and truncation
62+
# Prompt prefixes with multi-shard not yet supported
63+
singleShardOnly: true
64+
request:
65+
prefixId: bloom_sentiment_1
66+
params:
67+
truncateInputTokens: 10
68+
method: GREEDY
69+
stopping: {"maxNewTokens": 20}
70+
requests:
71+
- {"text": "[This will be truncated] What a wonderful day!:\nSentiment:"}
72+
response:
73+
responses:
74+
- generatedTokenCount: 2
75+
inputTokenCount: 10
76+
stopReason: EOS_TOKEN
77+
text: ' positive'
78+
6179

6280
# Prompt prefix with nested path
6381
- name: Greedy with tuned prompt prefix with nested path (id)

integration_tests/test_cases_mt0small.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,22 @@
9090
stopReason: EOS_TOKEN
9191
text: They are a wonderful day.
9292

93+
# Prompt prefix - decoder only with truncation
94+
- name: Greedy with tuned prompt prefix and truncation for decoder only
95+
request:
96+
prefixId: mt0_sentiment_decoder_only
97+
params:
98+
method: GREEDY
99+
truncateInputTokens: 12
100+
stopping: {"maxNewTokens": 20}
101+
requests:
102+
- {"text": "[This will be truncated] What a wonderful day!:\nSentiment:"}
103+
response:
104+
responses:
105+
- generatedTokenCount: 10
106+
inputTokenCount: 12
107+
stopReason: EOS_TOKEN
108+
text: They are a wonderful day.
93109

94110
# Prompt prefix returning input and generated tokens
95111
- name: Greedy with tuned prompt prefix and returned tokens

integration_tests/test_cases_tinystarcoderpy.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
text: "\nclass Shape(object):\n '''Shape class'''\n\n def __init__(self, x,"
3434

3535
# Basic Greedy (explicit)
36-
- name: Basic Greedy, max new tokens (implicit)
36+
- name: Basic Greedy, max new tokens (explicit)
3737
request:
3838
params:
3939
method: GREEDY
@@ -140,6 +140,24 @@
140140
stopReason: EOS_TOKEN
141141
text: "(\"Hello World!\")\n\nhello_world()\n"
142142

143+
- name: Greedy with tuned prompt prefix and truncation
144+
# Prompt prefixes with multi-shard not yet supported
145+
singleShardOnly: true
146+
request:
147+
# Prefix is "def hello_world():\n"
148+
prefixId: tiny_starcoder
149+
params:
150+
method: GREEDY
151+
truncateInputTokens: 2
152+
requests:
153+
- {"text": "[this will be truncated]\tprint"}
154+
response:
155+
responses:
156+
- generatedTokenCount: 12
157+
inputTokenCount: 2
158+
stopReason: EOS_TOKEN
159+
text: "(\"Hello World!\")\n\nhello_world()\n"
160+
143161

144162
# Prompt prefix returning input and generated tokens
145163
- name: Greedy with tuned prompt prefix and returned tokens

0 commit comments

Comments
 (0)