如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
TTS(文本转语音)微服务帮助用户将文本转换为语音。在构建带LLM的对话机器人时,用户可能需要将LLM生成的回答以音频形式呈现,本微服务正是为这一转换环节设计。
bashcd comps/third_parties/speecht5/src nohup python speecht5_server.py --device=cpu & curl http://localhost:7055/v1/tts -XPOST -d '{"text": "Who are you?"}' -H 'Content-Type: application/json'
bashpip install optimum[habana] cd comps/third_parties/speecht5/src nohup python speecht5_server.py --device=hpu & curl http://localhost:7055/v1/tts -XPOST -d '{"text": "Who are you?"}' -H 'Content-Type: application/json'
bashpython opea_tts_microservice.py curl http://localhost:9088/v1/audio/speech -XPOST -d '{"input": "Who are you?"}' -H 'Content-Type: application/json' --output speech.mp3
您也可以通过Docker启动TTS微服务。
2.1.1 SpeechT5服务器镜像
bashcd ../../../ docker build -t opea/speecht5:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/third_parties/speecht5/src/Dockerfile .
bashcd ../../../ docker build -t opea/speecht5-gaudi:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/third_parties/speecht5/src/Dockerfile.intel_hpu .
2.1.2 TTS服务镜像
bashdocker build -t opea/tts:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/tts/src/Dockerfile .
2.2.1 启动SpeechT5服务器
bashdocker run -p 7055:7055 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy docker.xuanyuan.run/opea/speecht5:latest
bashdocker run -p 7055:7055 --runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy docker.xuanyuan.run/opea/speecht5-gaudi:latest
2.2.2 启动TTS服务
baship_address=$(hostname -I | awk '{print $1}') docker run -p 9088:9088 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e TTS_ENDPOINT=http://$ip_address:7055 docker.xuanyuan.run/opea/tts:latest
2.2.3 测试
bashcurl http://localhost:7055/v1/tts -XPOST -d '{"text": "Who are you?"}' -H 'Content-Type: application/json' # 兼容OpenAI协议 # 语音可选'male'或'default' curl http://localhost:9088/v1/audio/speech -XPOST -d '{"input":"Who are you?", "voice": "male"}' -H 'Content-Type: application/json' --output speech.wav
您也可以通过Docker Compose启动TTS微服务。
bashexport ip_address=$(hostname -I | awk '{print $1}') # 默认speecht5端口7055 export TTS_ENDPOINT=[***] # 默认gptsovits端口9880 # 如果您想使用gptsovits,请执行以下命令替代 # export TTS_ENDPOINT=[***] export no_proxy=localhost,$no_proxy # speecht5 cpu docker compose -f ../deployment/docker_compose/compose.yaml up speecht5-service tts-speecht5 -d # speecht5 hpu docker compose -f ../deployment/docker_compose/compose.yaml up speecht5-gaudi-service tts-speecht5-gaudi -d # gptsovits cpu docker compose -f ../deployment/docker_compose/compose.yaml up tts-gptsovits gpt-sovits-service -d # 测试 curl http://localhost:9088/v1/audio/speech -XPOST -d '{"input":"Who are you?"}' -H 'Content-Type: application/json' --output speech.wav
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务