From 4d67e08723227975b4b199634829367287addccf Mon Sep 17 00:00:00 2001 From: yanrk123 <2493404415@qq.com> Date: Tue, 18 Mar 2025 14:11:22 +0800 Subject: [PATCH] Fix the issue with Chinese description in drawing. --- bot/modelscope/modelscope_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/modelscope/modelscope_bot.py b/bot/modelscope/modelscope_bot.py index 752394a..238ac59 100644 --- a/bot/modelscope/modelscope_bot.py +++ b/bot/modelscope/modelscope_bot.py @@ -262,7 +262,7 @@ class ModelScopeBot(Bot): url = "https://api-inference.modelscope.cn/v1/images/generations" # 手动序列化并保留中文(禁用 ASCII 转义) - json_payload = json.dumps(payload, ensure_ascii=False) + json_payload = json.dumps(payload, ensure_ascii=False).encode('utf-8') # 使用 data 参数发送原始字符串(requests 会自动处理编码) res = requests.post(url, headers=headers, data=json_payload)