当前位置: 首页 > article >正文

调用 Xinference OpenAI接口时报错 Model not found in the model list, uid

错误如下, 请不要被错误吓住或蒙蔽双眼, 自己看最下面的报错内容

Traceback (most recent call last):
  File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\responses.py", line 259, in __call__
    await wrap(partial(self.listen_for_disconnect, receive))
  File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\responses.py", line 255, in wrap
    await func()
  File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\responses.py", line 232, in listen_for_disconnect
    message = await receive()
              ^^^^^^^^^^^^^^^
  File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 555, in receive
    await self.message_event.wait()
  File "C:\Users\HW\.conda\envs\aibot\Lib\asyncio\locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 25257b8d810
During handling of the above exception, another exception occurred:
  + Exception Group Traceback (most recent call last):
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 401, in run_asgi
  |     result = await app(  # type: ignore[func-returns-value]
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__
  |     return await self.app(scope, receive, send)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\fastapi\applications.py", line 1054, in __call__
  |     await super().__call__(scope, receive, send)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\applications.py", line 113, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\middleware\errors.py", line 187, in __call__
  |     raise exc
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\middleware\errors.py", line 165, in __call__
  |     await self.app(scope, receive, _send)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in __call__
  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
  |     raise exc
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\routing.py", line 715, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\routing.py", line 735, in app
  |     await route.handle(scope, receive, send)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\routing.py", line 288, in handle
  |     await self.app(scope, receive, send)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\routing.py", line 76, in app
  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
  |     raise exc
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\routing.py", line 74, in app
  |     await response(scope, receive, send)
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\responses.py", line 252, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\anyio\_backends\_asyncio.py", line 763, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\responses.py", line 255, in wrap
    |     await func()
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\starlette\responses.py", line 244, in stream_response
    |     async for chunk in self.body_iterator:
    |   File "D:\codes\aibot\ask.py", line 49, in answer_generator
    |     for chunk in retrieval_chain.stream({"input": f"{request.question}"}):
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 5525, in stream
    |     yield from self.bound.stream(
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 3407, in stream
    |     yield from self.transform(iter([input]), config, **kwargs)
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 3394, in transform
    |     yield from self._transform_stream_with_config(
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 2197, in _transform_stream_with_config
    |     chunk: Output = context.run(next, iterator)  # type: ignore
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 3357, in _transform
    |     yield from final_pipeline
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\passthrough.py", line 576, in transform
    |     yield from self._transform_stream_with_config(
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 2197, in _transform_stream_with_config
    |     chunk: Output = context.run(next, iterator)  # type: ignore
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\passthrough.py", line 566, in _transform
    |     yield cast(dict[str, Any], first_map_chunk_future.result())
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\concurrent\futures\_base.py", line 456, in result
    |     return self.__get_result()
    |            ^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\concurrent\futures\_base.py", line 401, in __get_result
    |     raise self._exception
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\concurrent\futures\thread.py", line 58, in run
    |     result = self.fn(*self.args, **self.kwargs)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 3847, in transform
    |     yield from self._transform_stream_with_config(
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 2197, in _transform_stream_with_config
    |     chunk: Output = context.run(next, iterator)  # type: ignore
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 3832, in _transform
    |     chunk = AddableDict({step_name: future.result()})
    |                                     ^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\concurrent\futures\_base.py", line 449, in result
    |     return self.__get_result()
    |            ^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\concurrent\futures\_base.py", line 401, in __get_result
    |     raise self._exception
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\concurrent\futures\thread.py", line 58, in run
    |     result = self.fn(*self.args, **self.kwargs)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 5561, in transform
    |     yield from self.bound.transform(
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 3394, in transform
    |     yield from self._transform_stream_with_config(
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 2197, in _transform_stream_with_config
    |     chunk: Output = context.run(next, iterator)  # type: ignore
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 3357, in _transform
    |     yield from final_pipeline
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\output_parsers\transform.py", line 64, in transform
    |     yield from self._transform_stream_with_config(
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 2161, in _transform_stream_with_config
    |     final_input: Optional[Input] = next(input_for_tracing, None)
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\runnables\base.py", line 1431, in transform
    |     yield from self.stream(final, config, **kwargs)
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\language_models\chat_models.py", line 420, in stream
    |     raise e
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_core\language_models\chat_models.py", line 400, in stream
    |     for chunk in self._stream(messages, stop=stop, **kwargs):
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\langchain_openai\chat_models\base.py", line 658, in _stream
    |     response = self.client.create(**payload)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\openai\_utils\_utils.py", line 274, in wrapper
    |     return func(*args, **kwargs)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\openai\resources\chat\completions.py", line 815, in create
    |     return self._post(
    |            ^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\openai\_base_client.py", line 1277, in post
    |     return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\openai\_base_client.py", line 954, in request
    |     return self._request(
    |            ^^^^^^^^^^^^^^
    |   File "C:\Users\HW\.conda\envs\aibot\Lib\site-packages\openai\_base_client.py", line 1058, in _request
    |     raise self._make_status_error_from_response(err.response) from None
    | openai.BadRequestError: Error code: 400 - {'detail': '[address=0.0.0.0:12781, pid=304366] Model not found in the model list, uid: qwen2.5-instruct123'}

这里面列出来了找不到model, uid, 在加载模型时, Model UlD, model name by default 可选字段一定要填, 不填的话可能会生成随机的一个ID, 导致调用时找不到模型

重新加载模型, 按如下图示设置名称即可, 使用时使用设置的MODEL UID即可


http://www.kler.cn/a/395518.html

相关文章:

  • 博物馆实景复刻:开启沉浸式文化体验的新篇章
  • 31-Shard Allocation Awareness(机架感知)
  • 《Probing the 3D Awareness of Visual Foundation Models》论文解析——多视图一致性
  • kubesphere环境-本地Harbor仓库+k8s集群(单master 多master)+Prometheus监控平台部署
  • 使用 VS Code 远程连接时解决 OpenSSL 版本不匹配及权限问题
  • 从H264视频中获取宽、高、帧率、比特率等属性信息
  • 前端埋点、监控
  • 如何保证MySQL与Redis缓存的数据一致性?
  • PC上浏览器是如何查询DNS 缓存的呢?
  • 自建k8s集群,利用开源的GitLab、Jenkins和Harbor实现CI/CD和DevOps的过程回顾
  • Redis 概 述 和 安 装
  • C++初阶——stack
  • 服务器被挂马怎么办?——解决服务器被挂马的方法和步骤
  • 10款录屏工具个人使用感分享!!!!!!
  • 用MVVM设计模式提升WPF开发体验:分层架构与绑定实例解析
  • 深度学习之GAN应用
  • Springboot 整合 itext 实现PDF文件合并,识别图片则转成PDF拼接
  • C++图案例大全
  • 算法----阶乘问题
  • java算法性能调优:详尽探讨时间复杂度与空间复杂度的分析与优化“
  • 3D Web渲染引擎HOOPS Communicator:助力企业打造定制化3D可视化产品的强大工具
  • 后端:Spring AOP原理--动态代理
  • 联邦学习的未来:深入剖析FedAvg算法与数据不均衡的解决之道
  • 游戏引擎学习第九天
  • Javascript高级—搜索算法
  • Kafka节点服役和退役