This commit is contained in:
parent
b42b5f090b
commit
ccf3398741
12
meta_ui.py
12
meta_ui.py
|
|
@ -19,8 +19,10 @@ def chat(user_message, history, max_tokens, temperature):
|
||||||
payload = {
|
payload = {
|
||||||
"model": MODEL_NAME,
|
"model": MODEL_NAME,
|
||||||
"text": user_message, # generate 使用 text
|
"text": user_message, # generate 使用 text
|
||||||
"max_tokens": max_tokens,
|
"sampling_params": { # ★ 放进 sampling_params
|
||||||
"temperature": temperature
|
"max_new_tokens": int(max_tokens),
|
||||||
|
"temperature": temperature
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print(f"\n🟡 [{now()} chat] payload:\n{json.dumps(payload, ensure_ascii=False, indent=2)}")
|
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 = {
|
payload = {
|
||||||
"model": MODEL_NAME,
|
"model": MODEL_NAME,
|
||||||
"text": "Ping?",
|
"text": "Ping?",
|
||||||
"max_tokens": max_tokens,
|
"sampling_params": { # ★ 同样改这里 ★
|
||||||
"temperature": temperature
|
"max_new_tokens": int(max_tokens),
|
||||||
|
"temperature": temperature
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print(f"\n🔵 [{now()} test] payload:\n{json.dumps(payload, ensure_ascii=False, indent=2)}")
|
print(f"\n🔵 [{now()} test] payload:\n{json.dumps(payload, ensure_ascii=False, indent=2)}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue