This commit is contained in:
hailin 2025-07-27 12:07:21 +08:00
parent b42b5f090b
commit ccf3398741
1 changed files with 8 additions and 4 deletions

View File

@ -19,8 +19,10 @@ def chat(user_message, history, max_tokens, temperature):
payload = {
"model": MODEL_NAME,
"text": user_message, # generate 使用 text
"max_tokens": max_tokens,
"temperature": temperature
"sampling_params": { # ★ 放进 sampling_params
"max_new_tokens": int(max_tokens),
"temperature": temperature
}
}
print(f"\n🟡 [{now()} chat] payload:\n{json.dumps(payload, ensure_ascii=False, indent=2)}")
@ -59,8 +61,10 @@ def test_api(max_tokens, temperature):
payload = {
"model": MODEL_NAME,
"text": "Ping?",
"max_tokens": max_tokens,
"temperature": temperature
"sampling_params": { # ★ 同样改这里 ★
"max_new_tokens": int(max_tokens),
"temperature": temperature
}
}
print(f"\n🔵 [{now()} test] payload:\n{json.dumps(payload, ensure_ascii=False, indent=2)}")