-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker容器启动程序后无法访问 #346
Comments
求大恨帮忙,到底什么原因? |
起了两个容器,无论是端口映射还是host网络都是一样的 docker run -p 7860:7860 --name fish-speech-myself -v E:\gitProject\fish-speech:/exp -d --gpus all fish-speech-fish-speech tail -f /dev/null docker run --network host --name fish-speech-myself -v E:\gitProject\fish-speech:/exp -d --gpus all fish-speech-fish-speech tail -f /dev/null |
在命令行里输入 netstat -ano | findstr :7860 看看是否有占用。 |
https://speech.fish.audio/inference/#webui 这个问题跟gradio相关,要使用demo.launch(..., server_name="0.0.0.0") |
这是正确的 但是我启动推理页面总是说端口占用 但是实际上端口并没有被使用 2024-07-17 06:05:50.748 | INFO | tools.llama.generate:generate_long:509 - Generating sentence 1/1 of sample 1/1 |
0.0.0.0 |
感谢! 手滑输错了~ |
#!/bin/bash
# 设置字符编码
export LC_ALL=en_US.UTF-8
# 设置初始变量
USE_MIRROR=true
PYTHON_CMD=python
API_FLAG_PATH=$(dirname "$0")/API_FLAGS.txt
# 设置默认的端点
HF_ENDPOINT="https://huggingface.co"
no_proxy=""
# 如果指定了使用镜像,则设置镜像地址
if [ "$USE_MIRROR" == "true" ]; then
HF_ENDPOINT="https://hf-mirror.com"
no_proxy="localhost, 127.0.0.1, 0.0.0.0"
fi
echo "HF_ENDPOINT: $HF_ENDPOINT"
echo "NO_PROXY: $no_proxy"
# 运行模型下载脚本
$PYTHON_CMD ./tools/download_models.py
# 初始化API标志
API_FLAGS=""
flags=""
# 如果存在API标志文件,则处理文件中的标志
if [ -f "$API_FLAG_PATH" ]; then
while IFS= read -r line; do
if [ "${line:0:1}" != "#" ]; then
line=$(echo "$line" | sed 's/ /<SPACE>/g' | sed 's/\\//g' | sed 's/<SPACE>/ /g')
if [ ! -z "$line" ]; then
API_FLAGS="$API_FLAGS$line "
fi
fi
done < "$API_FLAG_PATH"
fi
# 去除API_FLAGS末尾的空格
API_FLAGS=$(echo "$API_FLAGS" | sed 's/ *$//')
# 检查模式标志并相应地设置模式
echo "$API_FLAGS" | grep -q -- "--api"
if [ $? -eq 0 ]; then
echo
echo "启动HTTP API..."
mode="api"
process_flags
fi
echo "$API_FLAGS" | grep -q -- "--infer"
if [ $? -eq 0 ]; then
echo
echo "启动WebUI推理..."
mode="infer"
process_flags
fi
# 处理剩余标志
process_flags() {
for p in $API_FLAGS; do
if [ "$p" != "--$mode" ]; then
flags="$flags $p"
fi
done
flags=$(echo "$flags" | sed 's/^ *//')
}
# 输出调试信息
echo "调试: flags = $flags"
# 设置环境变量 GRADIO_SERVER_NAME
export GRADIO_SERVER_NAME="0.0.0.0"
# 运行相应模式
if [ "$mode" == "api" ]; then
$PYTHON_CMD -m tools.api $flags
elif [ "$mode" == "infer" ]; then
$PYTHON_CMD -m tools.webui $flags
fi
echo
echo "接下来启动页面..."
$PYTHON_CMD fish_speech/webui/manage.py
# 脚本结束 用这个启动脚本 |
Open Labeler WebUI 这个好像打不开2024-07-17 06:51:58.924 | INFO | main::507 - Warming up done, launching the web UI... |
用在线版吧。这个要单独下载,解压后里面的文件放项目根目录下。 |
感谢大佬 |
|
可能是没有权限导致的, |
通过docker成功启动程序,也开启了webui,但是奇怪的是容器内可以访问127.0.0.1:7860但是宿主机无法访问。
1、已经做了端口映射,无效
2、容器采用host模式,无效
3、容器内可以ping通宿主机,但宿主机无法ping通容器ip
4、容器内可以访问页面
The text was updated successfully, but these errors were encountered: