Xinference 常见bug: "detail": "Invalid input. Please specify the prompt."

"detail": "Invalid input. Please specify the prompt."

if not messages or messages[-1].get("role") not in ["user", "system", "tool"]:

raise HTTPException(

status_code=400, detail="Invalid input. Please specify the prompt."

)https://openi.pcl.ac.cn/o3sky/inference/src/tag/v0.11.2.post1/xinference/api/restful_api.py:1281

我方法是:

if len(messages)>2:

messages[-1]['role']='system'

相关推荐
MATLAB代码顾问13 分钟前
改进遗传算法(IGA)求解作业车间调度问题(JSSP)——附MATLAB代码
开发语言·matlab
syker31 分钟前
AIFerric深度学习框架:自研全栈AI基础设施的技术全景
开发语言·c++
HSunR44 分钟前
dify 搭建ai作业批改流
开发语言·前端·javascript
zhaoyong2221 小时前
MySQL 存储过程中字符集与排序规则不匹配导致查询性能下降的解决方案
jvm·数据库·python
sinat_383437361 小时前
golang如何从Python转型Go开发_golang从Python转型Go开发攻略
jvm·数据库·python
代码不加糖1 小时前
2026 跨境电商独立站实战:从 0 到 1 搭建高转化 SaaS 商城(附源码)
开发语言·前端·javascript
rockey6271 小时前
基于AScript的python3脚本语言发布啦!
python·c#·.net·script·python3·eval·expression·function·动态脚本
时空系1 小时前
第9篇:成员功能——为结构体添加能力 Rust中文编程
开发语言·网络·rust
gqk011 小时前
Python入门
python
MATLAB代码顾问1 小时前
多种群协同进化算法(MPCE)求解大规模作业车间调度问题——附MATLAB代码
开发语言·算法·matlab