services:
xinference:
image: python:3.11-slim
container_name: xinference-server
ports:
- "9997:9997"
volumes:
# 挂载本地模型缓存目录
- C:\Users\Administrator\.xinference:/root/.xinference
# 挂载HuggingFace缓存目录(如果存在)
- C:\Users\Administrator\.cache\huggingface:/root/.cache/huggingface
environment:
- XINFERENCE_HOME=/root/.xinference
- CUDA_VISIBLE_DEVICES=0
- PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
command: >
bash -c "
pip install xinference[transformers] torch --no-cache-dir &&
xinference-local --host 0.0.0.0 --port 9997
"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
networks:
- xinference-network
networks:
xinference-network:
driver: bridge
- 后台启动: docker exec -d ragflow-server bash -lc "nohup python -m xinference.deploy.local --host 0.0.0.0 --port 9997 > /tmp/xinference.log 2>&1 &"
1万+

被折叠的 条评论
为什么被折叠?



