Skip to content

Commit fb7a068

Browse files
authored
add more cases (#3207)
1 parent c593e1a commit fb7a068

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

test/ce/server/test_base_chat.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_stop_sequence():
8080
"messages": [
8181
{
8282
"role": "user",
83-
"content": "你要严格按照我接下来的话输出,输出冒号后面的内容,请输出:这是第一段。这是第二段啦啦啦啦啦。",
83+
"content": "你要严格按照我接下来的话输出,输出冒号后面的内容,请输出:这是第一段。果冻这是第二段啦啦啦啦啦。",
8484
},
8585
],
8686
"max_tokens": 20,
@@ -96,6 +96,25 @@ def test_stop_sequence():
9696
assert "。" in token_list, "没有找到。符号"
9797

9898

99+
def test_stop_sequence1():
100+
data = {
101+
"stream": False,
102+
"messages": [
103+
{
104+
"role": "user",
105+
"content": "你要严格按照我接下来的话输出,输出冒号后面的内容,请输出:这是第一段。果冻这是第二段啦啦啦啦啦。",
106+
},
107+
],
108+
"max_tokens": 20,
109+
"top_p": 0,
110+
}
111+
payload = build_request_payload(TEMPLATE, data)
112+
resp = send_request(URL, payload).json()
113+
content = resp["choices"][0]["message"]["content"]
114+
print("截断输出:", content)
115+
assert "第二段" in content
116+
117+
99118
def test_sampling_parameters():
100119
data = {
101120
"stream": False,

0 commit comments

Comments
 (0)