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'

相关推荐
yaodong5186 小时前
Gemini长上下文重塑RAG架构
开发语言·php
努力学习_小白6 小时前
SE注意力机制——学习记录
pytorch·python·深度学习
u0110225126 小时前
JavaScript中Tree-shaking失效的场景及其优化对策
jvm·数据库·python
风味蘑菇干6 小时前
继承 + static + final 综合应用
java·开发语言
紫小米6 小时前
Agent的范式
prompt·embedding·ai编程
IT策士6 小时前
Python 面试系列:常见 100 个经典面试问题,从入门到进阶
开发语言·python·面试
阿正呀6 小时前
如何显著提升 Google Sheets 数据库批量更新脚本的执行效率
jvm·数据库·python
想取一个与众不同的名字好难6 小时前
QT webSocket接收客户端发送的双目摄像头数据并显示
开发语言·qt·websocket
dFObBIMmai6 小时前
MySQL迁移过程如何避免数据不一致_利用强一致性备份方案
jvm·数据库·python
驼同学.6 小时前
【求职季】LeetCode Hot 100 渐进式扫盲手册(Python版)
python·算法·leetcode