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'

相关推荐
青瓷程序设计2 小时前
动物识别系统【最新版】Python+TensorFlow+Vue3+Django+人工智能+深度学习+卷积神经网络算法
人工智能·python·深度学习
tobebetter95272 小时前
How to manage python versions on windows
开发语言·windows·python
F_D_Z2 小时前
数据集相关类代码回顾理解 | sns.distplot\%matplotlib inline\sns.scatterplot
python·深度学习·matplotlib
9***P3343 小时前
PHP代码覆盖率
开发语言·php·代码覆盖率
daidaidaiyu3 小时前
一文入门 LangGraph 开发
python·ai
CoderYanger3 小时前
优选算法-栈:67.基本计算器Ⅱ
java·开发语言·算法·leetcode·职场和发展·1024程序员节
jllllyuz3 小时前
Matlab实现基于Matrix Pencil算法实现声源信号角度和时间估计
开发语言·算法·matlab
多多*4 小时前
Java复习 操作系统原理 计算机网络相关 2025年11月23日
java·开发语言·网络·算法·spring·microsoft·maven
p***43484 小时前
Rust网络编程模型
开发语言·网络·rust
ᐇ9594 小时前
Java集合框架深度实战:构建智能教育管理与娱乐系统
java·开发语言·娱乐