Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion framework/ServeTest/baseline.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
用户让我写巴黎圣母院,模仿《滕王阁序》。首先,我需要理解《滕王阁序》的结构和特点。这篇骈文以骈散结合的方式,讲究对仗和押韵,结构严谨,气势磅礴,常用典故和自然景物来烘托
<response>温故而知新是一句成语,意思是复习旧知识,从而得到新知识。</response><|im_end|>
39 changes: 19 additions & 20 deletions framework/ServeTest/test_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,33 +65,32 @@ def get_stream_chunks(response):


def test_diff():
# 如果将chat_template拼接在输入中,需要把disable_chat_template设为True
# 注:sft后模型模版,预训练模型没法识别这些特殊token
text = (
"<|im_start|>system\n"
"<global_setting>\n"
"think_mode=True\n"
"</global_setting><|im_end|>\n"
"\n"
"<|im_start|>user\n"
"写巴黎圣母院,模仿《滕王阁序》<|im_end|>\n"
"\n"
"<|im_start|>assistant\n"
"<think>"
)

# tokenizer_config.json需要配置chat_template
# text = "写巴黎圣母院,模仿《滕王阁序》"
payload = {
"model": "null",
"messages": [
{"role": "user", "content": text},
{
"role": "user",
"content": [
{
"type": "text",
"text": "解释一下温故而知新",
},
],
},
],
"stream": True,
"max_tokens": 64,
"temperature": 1.0,
"seed": 21,
"top_p": 0,
"disable_chat_template": True
"stop": ["</s>", "<eos>", "<|endoftext|>", "<|im_end|>"],
"metadata": {
"chat_template_kwargs": {
"options": {
"thinking_mode": "close",
},
},
"bad_words_token_ids": [101031, 101032, 101027, 101028, 101023, 101024],
}
}

print("fastdeploy answer is :")
Expand Down
Loading