HongCheng
|
b47a102994
|
Update zhipuai_gen_data.py 添加glm-4 response获取异常处理
# 解决方法
``` python
try:
response = client.chat.completions.create(
model='glm-4',
messages=messages,
top_p=top_p,
)
except:
response = client.chat.completions.create(
model='glm-4',
messages=messages,
top_p=top_p,
)
```
# 报错
``` python
# Error code: 400, with error text {"error":{"code":"1301","message":"系统检测到输入或生成内容可能包含不安全或敏感内容,请您避免输入易产生敏感内容的提示语,感谢您的配合。"}}
```
|
2024-03-17 08:45:33 +09:00 |
|