From ccf3398741160f500ff8a7320fbc27b2c5e1f479 Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 27 Jul 2025 12:07:21 +0800 Subject: [PATCH] . --- meta_ui.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meta_ui.py b/meta_ui.py index 7560d82..5ad97d8 100644 --- a/meta_ui.py +++ b/meta_ui.py @@ -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)}")