MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / test_stop_seq_exceed_length

Function test_stop_seq_exceed_length

tests/ce/server/test_evil_cases.py:127–138  ·  view source on GitHub ↗

stop 中包含长度超过 FD_STOP_SEQS_MAX_LEN 的元素,服务应报错

()

Source from the content-addressed store, hash-verified

125
126
127def test_stop_seq_exceed_length():
128 """stop 中包含长度超过 FD_STOP_SEQS_MAX_LEN 的元素,服务应报错"""
129 data = {
130 "stream": False,
131 "messages": [{"role": "user", "content": "非洲的首都是?"}],
132 "top_p": 0,
133 "stop": ["11", "今天天气比明天好多了,请问你会出门还是和我一起玩"],
134 }
135 payload = build_request_payload(TEMPLATE, data)
136 resp = send_request(URL, payload).json()
137 assert resp.get("error").get("type") == "invalid_request_error", "stop 超出长度应触发异常"
138 assert "exceeds the limit stop_seqs_max_len" in resp.get("error").get("message", ""), "未返回预期的报错信息"
139
140
141def test_multilingual_input():

Callers

nothing calls this directly

Calls 3

build_request_payloadFunction · 0.90
send_requestFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected