Skip to content

Commit 4d67e08

Browse files
committed
Fix the issue with Chinese description in drawing.
1 parent 2e71dd5 commit 4d67e08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bot/modelscope/modelscope_bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def create_img(self, query, retry_count=0):
262262
url = "https://api-inference.modelscope.cn/v1/images/generations"
263263

264264
# 手动序列化并保留中文(禁用 ASCII 转义)
265-
json_payload = json.dumps(payload, ensure_ascii=False)
265+
json_payload = json.dumps(payload, ensure_ascii=False).encode('utf-8')
266266

267267
# 使用 data 参数发送原始字符串(requests 会自动处理编码)
268268
res = requests.post(url, headers=headers, data=json_payload)

0 commit comments

Comments
 (0)