最新的cpu版本,模型起不来
System Info / 系統信息
尝试了 registry.cn-hangzhou.aliyuncs.com/xprobe_xinference/xinference:latest-cpu (镜像id: 7892712e1798)
和 xprobe/xinference:nightly-main-cpu
容器启动没问题,但是加载模型的时候报错:
(base) root@31a37f59a02e:/# xinference launch --model-name bge-large-zh-v1.5 --model-type embedding --n-gpu none
Launch model name: bge-large-zh-v1.5 with kwargs: {}
Traceback (most recent call last):
File "/opt/conda/bin/xinference", line 8, in
应该是 timm版本问题,默认我看安装的是 0.6.7,然后我尝试强制升级 timm pip install --upgrade timm ,它给我升级到了 1.0.14 ,但是提示我 跟 controlnet-aux 0.0.9 不兼容了,这个要求 timm的版本是<=0.6.7 但是 上面的模型加载可以正常执行了
这个问题还是请官方修复一下吧,我也不知道 我强制升级 timm会不会导致其他的问题
Running Xinference with Docker? / 是否使用 Docker 运行 Xinfernece?
- [x] docker / docker
- [ ] pip install / 通过 pip install 安装
- [ ] installation from source / 从源码安装
Version info / 版本信息
registry.cn-hangzhou.aliyuncs.com/xprobe_xinference/xinference:latest-cpu
The command used to start Xinference / 用以启动 xinference 的命令
docker run --name xinference -d -p 11021:9997 -v /data/xinference:/data -e XINFERENCE_MODEL_SRC='modelscope' -e XINFERENCE_HOME=/data --restart always registry.cn-hangzhou.aliyuncs.com/xprobe_xinference/xinference:latest-cpu xinference-local -H 0.0.0.0 --auth-config=/data/config/config.conf --log-level debug
Reproduction / 复现过程
- 启动容器
- 进入容器 执行命令加载已缓存的模型,就报错了,或者在 web管理台中 加载模型也会有一样的报错
Expected behavior / 期待表现
希望修复此问题
This issue is stale because it has been open for 7 days with no activity.
same issue with model jina-embeddings-v2-base-zh and jina-embeddings-v3 xinference cpu docker image version is v1.2.2-cpu
/bge-m3
Encounter same issue on model : multilingual-e5-large-instruct
的确更新如下包可以解决。
docker exec -it xinference bash pip install "timm>=0.9.16" controlnet-aux
I've tried to run this framework with 'xinference-local --host 0.0.0.0 --port 9997' instead of 'docker', it worked.
用官方的docker-cpu版本,一堆问题,搞了一个星期放弃了,后面改成空白docker容器内部安装conda和xinference,反而能正常跑模型了,记得别用官方docker-cpu,就是坑。。。
官方最新版本:1.4.1-cpu版本容器无法启动:
启动命令:
docker run -d --name xinference141 -v /data/xinference:/xinference -e XINFERENCE_HOME=/xinference -p 9997:9997 xprobe/xinference:v1.4.1-cpu xinference-local -H 0.0.0.0 --log-level debug 2cec77fd76dda267cf8fdbc0f23b81d879599ec73e6c8a5fcb1cc715a5ef2a83
容器日志:
`2025-04-08 06:46:31,510 xinference.core.supervisor 24 INFO Xinference supervisor 0.0.0.0:44110 started
2025-04-08 06:46:31,540 xinference.core.worker 24 INFO Starting metrics export server at 0.0.0.0:None
2025-04-08 06:46:31,543 xinference.core.worker 24 INFO Checking metrics export server...
2025-04-08 06:46:33,908 xinference.core.worker 24 INFO Metrics server is started at: http://0.0.0.0:37593
2025-04-08 06:46:33,909 xinference.core.worker 24 INFO Purge cache directory: /xinference/cache
2025-04-08 06:46:33,911 xinference.core.supervisor 24 DEBUG [request 35f63ec2-1445-11f0-87c6-0242ac110002] Enter add_worker, args: <xinference.core.supervisor.SupervisorActor object at 0x7f30c2b5cad0>,0.0.0.0:44110, kwargs:
2025-04-08 06:46:33,912 xinference.core.supervisor 24 DEBUG Worker 0.0.0.0:44110 has been added successfully
2025-04-08 06:46:33,912 xinference.core.supervisor 24 DEBUG [request 35f63ec2-1445-11f0-87c6-0242ac110002] Leave add_worker, elapsed time: 0 s
2025-04-08 06:46:33,912 xinference.core.worker 24 INFO Connected to supervisor as a fresh worker
2025-04-08 06:46:33,934 xinference.core.worker 24 INFO Xinference worker 0.0.0.0:44110 started
2025-04-08 06:46:33,938 xinference.core.supervisor 24 DEBUG Worker 0.0.0.0:44110 resources: {'cpu': ResourceStatus(usage=0.0, total=8, memory_used=3172597760, memory_available=12951879680, memory_total=16637235200)}
2025-04-08 06:46:36,488 xinference.core.supervisor 24 DEBUG Enter get_status, args: <xinference.core.supervisor.SupervisorActor object at 0x7f30c2b5cad0>, kwargs:
2025-04-08 06:46:36,488 xinference.core.supervisor 24 DEBUG Leave get_status, elapsed time: 0 s
2025-04-08 06:46:39,322 xinference.api.restful_api 1 INFO Starting Xinference at endpoint: http://0.0.0.0:9997
/opt/conda/lib/python3.11/site-packages/xinference/api/restful_api.py:845: UserWarning:
Xinference ui is not built at expected directory: /opt/conda/lib/python3.11/site-packages/xinference/web/ui/build/
To resolve this warning, navigate to /opt/conda/lib/python3.11/site-packages/xinference/web/ui/
And build the Xinference ui by running "npm run build"
warnings.warn( 2025-04-08 06:46:39,475 uvicorn.error 1 INFO Uvicorn running on http://0.0.0.0:9997 (Press CTRL+C to quit)` UI页面访问显示:
使用镜像xprobe/xinference:latest-cpu启动docker服务可以正常启动,但是无法加载运行模型,换用镜像docker-registry.neuedu.com/xprobe/xinference:v0.15.2-cpu启动docker容器可以正常运行,加载bge-m3\bge-rerank都可以启动并运行,curl\postman调用接口均没有问题,但是api调用向量化模型报错:2025-04-09 09:03:07,738 xinference.api.restful_api 1 ERROR Handling request http://192.168.3.54:9997/v1/embeddings failed: 7 validation errors for CreateEmbeddingRequest input str type expected (type=type_error.str) input -> 0 str type expected (type=type_error.str) input -> 1 str type expected (type=type_error.str) input -> 0 value is not a valid integer (type=type_error.integer) input -> 1 value is not a valid integer (type=type_error.integer) input -> 0 value is not a valid list (type=type_error.list) input -> 1 value is not a valid list (type=type_error.list) Traceback (most recent call last): File "/opt/conda/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/opt/conda/lib/python3.11/site-packages/aioprometheus/asgi/middleware.py", line 184, in call await self.asgi_callable(scope, receive, wrapped_send) File "/opt/conda/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in call await self.app(scope, receive, send) File "/opt/conda/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/opt/conda/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/opt/conda/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/opt/conda/lib/python3.11/site-packages/starlette/routing.py", line 756, in call await self.middleware_stack(scope, receive, send) File "/opt/conda/lib/python3.11/site-packages/starlette/routing.py", line 776, in app await route.handle(scope, receive, send) File "/opt/conda/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/opt/conda/lib/python3.11/site-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/opt/conda/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/opt/conda/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/opt/conda/lib/python3.11/site-packages/starlette/routing.py", line 72, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/xinference/api/restful_api.py", line 1256, in create_embedding body = CreateEmbeddingRequest.parse_obj(payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/pydantic/v1/main.py", line 526, in parse_obj return cls(**obj) ^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/pydantic/v1/main.py", line 341, in init raise validation_error pydantic.v1.error_wrappers.ValidationError: 7 validation errors for CreateEmbeddingRequest input str type expected (type=type_error.str) input -> 0 str type expected (type=type_error.str) input -> 1 str type expected (type=type_error.str) input -> 0 value is not a valid integer (type=type_error.integer) input -> 1 value is not a valid integer (type=type_error.integer) input -> 0 value is not a valid list (type=type_error.list) input -> 1 value is not a valid list (type=type_error.list) 数据格式已经检查没有任何问题,使用gpu版本的xinference部署同一个向量化模型及同样的接口调用没有问题,不确定是否该cpu安装包有没有问题?请求解决。
postman调用接口cpu返参如下:
postman调用接口gpu返参如下:
官方最新版本:1.4.1-cpu版本容器无法启动: 启动命令:
docker run -d --name xinference141 -v /data/xinference:/xinference -e XINFERENCE_HOME=/xinference -p 9997:9997 xprobe/xinference:v1.4.1-cpu xinference-local -H 0.0.0.0 --log-level debug 2cec77fd76dda267cf8fdbc0f23b81d879599ec73e6c8a5fcb1cc715a5ef2a83容器日志: `2025-04-08 06:46:31,510 xinference.core.supervisor 24 INFO Xinference supervisor 0.0.0.0:44110 started 2025-04-08 06:46:31,540 xinference.core.worker 24 INFO Starting metrics export server at 0.0.0.0:None 2025-04-08 06:46:31,543 xinference.core.worker 24 INFO Checking metrics export server... 2025-04-08 06:46:33,908 xinference.core.worker 24 INFO Metrics server is started at: http://0.0.0.0:37593 2025-04-08 06:46:33,909 xinference.core.worker 24 INFO Purge cache directory: /xinference/cache 2025-04-08 06:46:33,911 xinference.core.supervisor 24 DEBUG [request 35f63ec2-1445-11f0-87c6-0242ac110002] Enter add_worker, args: <xinference.core.supervisor.SupervisorActor object at 0x7f30c2b5cad0>,0.0.0.0:44110, kwargs: 2025-04-08 06:46:33,912 xinference.core.supervisor 24 DEBUG Worker 0.0.0.0:44110 has been added successfully 2025-04-08 06:46:33,912 xinference.core.supervisor 24 DEBUG [request 35f63ec2-1445-11f0-87c6-0242ac110002] Leave add_worker, elapsed time: 0 s 2025-04-08 06:46:33,912 xinference.core.worker 24 INFO Connected to supervisor as a fresh worker 2025-04-08 06:46:33,934 xinference.core.worker 24 INFO Xinference worker 0.0.0.0:44110 started 2025-04-08 06:46:33,938 xinference.core.supervisor 24 DEBUG Worker 0.0.0.0:44110 resources: {'cpu': ResourceStatus(usage=0.0, total=8, memory_used=3172597760, memory_available=12951879680, memory_total=16637235200)} 2025-04-08 06:46:36,488 xinference.core.supervisor 24 DEBUG Enter get_status, args: <xinference.core.supervisor.SupervisorActor object at 0x7f30c2b5cad0>, kwargs: 2025-04-08 06:46:36,488 xinference.core.supervisor 24 DEBUG Leave get_status, elapsed time: 0 s 2025-04-08 06:46:39,322 xinference.api.restful_api 1 INFO Starting Xinference at endpoint: http://0.0.0.0:9997 /opt/conda/lib/python3.11/site-packages/xinference/api/restful_api.py:845: UserWarning: Xinference ui is not built at expected directory: /opt/conda/lib/python3.11/site-packages/xinference/web/ui/build/ To resolve this warning, navigate to /opt/conda/lib/python3.11/site-packages/xinference/web/ui/ And build the Xinference ui by running "npm run build"warnings.warn( 2025-04-08 06:46:39,475 uvicorn.error 1 INFO Uvicorn running on http://0.0.0.0:9997 (Press CTRL+C to quit)` UI页面访问显示:
我跟你遇到同样的问题,这个版本镜像前端代码没编译导致的,降低镜像版本就行了
官方最新版本:1.4.1-cpu版本容器无法启动: 启动命令:
docker run -d --name xinference141 -v /data/xinference:/xinference -e XINFERENCE_HOME=/xinference -p 9997:9997 xprobe/xinference:v1.4.1-cpu xinference-local -H 0.0.0.0 --log-level debug 2cec77fd76dda267cf8fdbc0f23b81d879599ec73e6c8a5fcb1cc715a5ef2a83容器日志:2025-04-08 06:46:31,510 xinference.core.supervisor 24 INFO Xinference supervisor 0.0.0.0:44110 started 2025-04-08 06:46:31,540 xinference.core.worker 24 INFO Starting metrics export server at 0.0.0.0:None 2025-04-08 06:46:31,543 xinference.core.worker 24 INFO Checking metrics export server... 2025-04-08 06:46:33,908 xinference.core.worker 24 INFO Metrics server is started at: http://0.0.0.0:37593 2025-04-08 06:46:33,909 xinference.core.worker 24 INFO Purge cache directory: /xinference/cache 2025-04-08 06:46:33,911 xinference.core.supervisor 24 DEBUG [request 35f63ec2-1445-11f0-87c6-0242ac110002] Enter add_worker, args: <xinference.core.supervisor.SupervisorActor object at 0x7f30c2b5cad0>,0.0.0.0:44110, kwargs: 2025-04-08 06:46:33,912 xinference.core.supervisor 24 DEBUG Worker 0.0.0.0:44110 has been added successfully 2025-04-08 06:46:33,912 xinference.core.supervisor 24 DEBUG [request 35f63ec2-1445-11f0-87c6-0242ac110002] Leave add_worker, elapsed time: 0 s 2025-04-08 06:46:33,912 xinference.core.worker 24 INFO Connected to supervisor as a fresh worker 2025-04-08 06:46:33,934 xinference.core.worker 24 INFO Xinference worker 0.0.0.0:44110 started 2025-04-08 06:46:33,938 xinference.core.supervisor 24 DEBUG Worker 0.0.0.0:44110 resources: {'cpu': ResourceStatus(usage=0.0, total=8, memory_used=3172597760, memory_available=12951879680, memory_total=16637235200)} 2025-04-08 06:46:36,488 xinference.core.supervisor 24 DEBUG Enter get_status, args: <xinference.core.supervisor.SupervisorActor object at 0x7f30c2b5cad0>, kwargs: 2025-04-08 06:46:36,488 xinference.core.supervisor 24 DEBUG Leave get_status, elapsed time: 0 s 2025-04-08 06:46:39,322 xinference.api.restful_api 1 INFO Starting Xinference at endpoint: http://0.0.0.0:9997 /opt/conda/lib/python3.11/site-packages/xinference/api/restful_api.py:845: UserWarning: Xinference ui is not built at expected directory: /opt/conda/lib/python3.11/site-packages/xinference/web/ui/build/ To resolve this warning, navigate to /opt/conda/lib/python3.11/site-packages/xinference/web/ui/ And build the Xinference ui by running "npm run build" warnings.warn( 2025-04-08 06:46:39,475 uvicorn.error 1 INFO Uvicorn running on http://0.0.0.0:9997 (Press CTRL+C to quit)UI页面访问显示:我跟你遇到同样的问题,这个版本镜像前端代码没编译导致的,降低镜像版本就行了
所以您鏡像降版就可以正常使用jina的embeddings model了嗎? 想在問一下可以用的話是降到第幾版?
官方最新版本:1.4.1-cpu版本容器无法启动: 启动命令:
docker run -d --name xinference141 -v /data/xinference:/xinference -e XINFERENCE_HOME=/xinference -p 9997:9997 xprobe/xinference:v1.4.1-cpu xinference-local -H 0.0.0.0 --log-level debug 2cec77fd76dda267cf8fdbc0f23b81d879599ec73e6c8a5fcb1cc715a5ef2a83容器日志:2025-04-08 06:46:31,510 xinference.core.supervisor 24 INFO Xinference supervisor 0.0.0.0:44110 started 2025-04-08 06:46:31,540 xinference.core.worker 24 INFO Starting metrics export server at 0.0.0.0:None 2025-04-08 06:46:31,543 xinference.core.worker 24 INFO Checking metrics export server... 2025-04-08 06:46:33,908 xinference.core.worker 24 INFO Metrics server is started at: http://0.0.0.0:37593 2025-04-08 06:46:33,909 xinference.core.worker 24 INFO Purge cache directory: /xinference/cache 2025-04-08 06:46:33,911 xinference.core.supervisor 24 DEBUG [request 35f63ec2-1445-11f0-87c6-0242ac110002] Enter add_worker, args: <xinference.core.supervisor.SupervisorActor object at 0x7f30c2b5cad0>,0.0.0.0:44110, kwargs: 2025-04-08 06:46:33,912 xinference.core.supervisor 24 DEBUG Worker 0.0.0.0:44110 has been added successfully 2025-04-08 06:46:33,912 xinference.core.supervisor 24 DEBUG [request 35f63ec2-1445-11f0-87c6-0242ac110002] Leave add_worker, elapsed time: 0 s 2025-04-08 06:46:33,912 xinference.core.worker 24 INFO Connected to supervisor as a fresh worker 2025-04-08 06:46:33,934 xinference.core.worker 24 INFO Xinference worker 0.0.0.0:44110 started 2025-04-08 06:46:33,938 xinference.core.supervisor 24 DEBUG Worker 0.0.0.0:44110 resources: {'cpu': ResourceStatus(usage=0.0, total=8, memory_used=3172597760, memory_available=12951879680, memory_total=16637235200)} 2025-04-08 06:46:36,488 xinference.core.supervisor 24 DEBUG Enter get_status, args: <xinference.core.supervisor.SupervisorActor object at 0x7f30c2b5cad0>, kwargs: 2025-04-08 06:46:36,488 xinference.core.supervisor 24 DEBUG Leave get_status, elapsed time: 0 s 2025-04-08 06:46:39,322 xinference.api.restful_api 1 INFO Starting Xinference at endpoint: http://0.0.0.0:9997 /opt/conda/lib/python3.11/site-packages/xinference/api/restful_api.py:845: UserWarning: Xinference ui is not built at expected directory: /opt/conda/lib/python3.11/site-packages/xinference/web/ui/build/ To resolve this warning, navigate to /opt/conda/lib/python3.11/site-packages/xinference/web/ui/ And build the Xinference ui by running "npm run build" warnings.warn( 2025-04-08 06:46:39,475 uvicorn.error 1 INFO Uvicorn running on http://0.0.0.0:9997 (Press CTRL+C to quit)UI页面访问显示:我跟你遇到同样的问题,这个版本镜像前端代码没编译导致的,降低镜像版本就行了
所以您鏡像降版就可以正常使用jina的embeddings model了嗎? 想在問一下可以用的話是降到第幾版?
我用的镜像是xprobe/xinference:v1.4.0-cpu,启动命令如下:
docker run -d \
--name xinference \
-e XINFERENCE_MODEL_SRC=modelscope \
-e XINFERENCE_HOME=/root/xinference \
-v ~/xinference:/root/xinference \
-p 9997:9997 \
xprobe/xinference:v1.4.0-cpu \
xinference-local -H 0.0.0.0 --log-level debug
启动后页面可以打开,但启动向量模型报错,需要进入容器里安装下面的库
docker exec -it xinference bash
pip install "timm>=0.9.16" controlnet-aux
安装好后,重新在页面部署向量模型就可以了,我用的bge-large-zh-v1.5模型验证的没问题。
xprobe/xinference:v1.4.1-cpu没前端,xprobe/xinference:v1.4.0-cpu启动embedding模型报错: RuntimeError: [address=0.0.0.0:44065, pid=247] Failed to import transformers.models.timm_wrapper.configuration_timm_wrapper because of the following error (look up to see its traceback): cannot import name 'ImageNetInfo' from 'timm.data' (/opt/conda/lib/python3.11/site-packages/timm/data/init.py)
进入容器执行timm升级后目前看可用 pip install timm==1.0.13