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'

相关推荐
女王大人万岁4 分钟前
Go语言JSON标准库(encoding/json):功能解析与实战指南
服务器·开发语言·后端·golang·json
wjs20246 分钟前
Scala 基础语法
开发语言
.ZGR.7 分钟前
从游戏到实战的线程进阶之旅:智能无人机防空平台
java·开发语言·无人机
上海合宙LuatOS8 分钟前
LuatOS ——fota 升级教程
开发语言·人工智能·单片机·嵌入式硬件·物联网·php·硬件工程
NWU_白杨9 分钟前
智能无人机平台V4
java·开发语言·无人机
小高Baby@9 分钟前
Go语言中面向对象的三大特性之继承的理解
开发语言·后端·golang
小高Baby@9 分钟前
Go语言中面向对象的三大特性之封装的理解
开发语言·后端·golang
木卫二号Coding15 分钟前
第七十七篇-V100+llama-cpp-python-server+Qwen3-30B+GGUF
开发语言·python·llama
半夏知半秋15 分钟前
lua5.5版本新特性学习
开发语言·笔记·学习
木卫二号Coding15 分钟前
第七十六篇-V100+llama-cpp-python+Qwen3-30B+GGUF
开发语言·python·llama