You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
851 B
30 lines
851 B
import requests |
|
|
|
|
|
def test_ai_model(): |
|
url = "http://36.158.183.88:7777/v1/chat/completions" |
|
test_text = "今天天气真好我们去公园玩吧" |
|
|
|
payload = { |
|
"model": "Qwen3-32B", |
|
"messages": [ |
|
{"role": "user", "content": f"对以下文本添加标点符号,中文数字转阿拉伯数字。不修改文字内容。\n{test_text}"} |
|
], |
|
"chat_template_kwargs": {"enable_thinking": False} |
|
} |
|
|
|
try: |
|
response = requests.post(url, json=payload, timeout=30) |
|
response.raise_for_status() |
|
result = response.json() |
|
processed = result["choices"][0]["message"]["content"].strip() |
|
|
|
print(f"原文: {test_text}") |
|
print(f"处理后: {processed}") |
|
|
|
except Exception as e: |
|
print(f"错误: {e}") |
|
|
|
|
|
if __name__ == "__main__": |
|
test_ai_model() |