Skip to content
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

拜托文档能不能写清楚点怎么使用 #5

Open
zaojue405 opened this issue Apr 12, 2024 · 11 comments
Open

拜托文档能不能写清楚点怎么使用 #5

zaojue405 opened this issue Apr 12, 2024 · 11 comments

Comments

@zaojue405
Copy link

看了readme就运行了server.py,没用过fastapi,至少告诉我命令用法吧。。。。。看了半天代码,自己试着用http://127.0.0.1:5000/?text=%E4%BD%A0%E4%B8%8D%E8%A6%81%E8%BF%87%E6%9D%A5%E5%95%8A 才推理了一条音频。最后还是失败的那种。。。

@wang-zhix
Copy link

我的返回结果没声音,也不报错,不知道怎么修了

@zaojue405
Copy link
Author

zaojue405 commented Apr 12, 2024 via email

@ben0oil1
Copy link
Owner

看了readme就运行了server.py,没用过fastapi,至少告诉我命令用法吧。。。。。看了半天代码,自己试着用http://127.0.0.1:5000/?text=%E4%BD%A0%E4%B8%8D%E8%A6%81%E8%BF%87%E6%9D%A5%E5%95%8A 才推理了一条音频。最后还是失败的那种。。。

控制台有什么返回内容?

@ben0oil1
Copy link
Owner

我的返回结果没声音,也不报错,不知道怎么修了

你是用什么硬件设备?如果也是在手机上CPU推理,这个可能算力太差,正常情况下返回的就是一个音频文件。audio/wav格式

@wang-zhix
Copy link

我使用的linux cpu推理, 换了个模型,已经可以正常使用了 正在尝试写一个dockerfile

@shelli-site
Copy link

我使用的linux cpu推理, 换了个模型,已经可以正常使用了 正在尝试写一个dockerfile

Dockerfile写的怎么样啦?能分享一下吗?
下面是我的,花费了一天时间验证出来的,可用,但build时间很长,同时apt安装软件的速度极慢(可能安装了多余的软件)

FROM python:3.10.12

# 时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt update 
RUN apt -y install curl wget vim
RUN apt -y install libsndfile1 
RUN apt -y install freetds-dev unixodbc-dev
RUN apt -y install libgl1-mesa-glx
RUN apt -y install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev
RUN wget https://bootstrap.pypa.io/get-pip.py
# COPY get-pip.py get-pip.py
RUN python3 get-pip.py -i https://mirrors.aliyun.com/pypi/simple

RUN mkdir /code
COPY GPT-SoVITS-Server /code 
RUN python3 -m pip install soundfile tqdm scipy cn2an pypinyin torchaudio transformers jieba_fast jieba PyYAML pytorch-lightning -i https://mirrors.aliyun.com/pypi/simple
RUN python3 -m pip install librosa==0.9.2 -i https://mirrors.aliyun.com/pypi/simple
RUN python3 -m pip install numba==0.56.4 -i https://mirrors.aliyun.com/pypi/simple
RUN python3 -m pip install uvicorn matplotlib fastapi einops ffmpeg-python -i https://mirrors.aliyun.com/pypi/simple

RUN apt -y install ffmpeg
RUN echo "python3 server.py" >> /code/start.sh
WORKDIR /code

CMD ["/bin/bash","/code/start.sh"]

@wang-zhix
Copy link

我用了pytorch的基础镜像

需要在requirements.txt去掉torch

# torch==2.0.0
# torchvision==0.15.1

同时我删去了代码中所有torch_directml的相关内容

Makefile文件如下:

# CPU镜像
FROM cnstark/pytorch:2.0.0-py3.9.12-ubuntu20.04
# GPU镜像
# FROM cnstark/pytorch:2.0.0-py3.9.12-cuda11.8.0-ubuntu20.04

# 设置工作目录
WORKDIR /home

# 复制当前目录下的所有文件到工作目录
COPY . /home

# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai

# 安装ffmpeg
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg

# 安装可能需要的依赖
RUN python3 -m pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

@mrly2333
Copy link

mrly2333 commented May 6, 2024

我用了pytorch的基础镜像

需要在requirements.txt去掉torch

# torch==2.0.0
# torchvision==0.15.1

同时我删去了代码中所有torch_directml的相关内容

Makefile文件如下:

# CPU镜像
FROM cnstark/pytorch:2.0.0-py3.9.12-ubuntu20.04
# GPU镜像
# FROM cnstark/pytorch:2.0.0-py3.9.12-cuda11.8.0-ubuntu20.04

# 设置工作目录
WORKDIR /home

# 复制当前目录下的所有文件到工作目录
COPY . /home

# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai

# 安装ffmpeg
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg

# 安装可能需要的依赖
RUN python3 -m pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

你好,可以打包分享下镜像吗,纯cpu推理

@wang-zhix
Copy link

wang-zhix commented May 6, 2024

我用了pytorch的基础镜像

需要在requirements.txt去掉torch

# torch==2.0.0
# torchvision==0.15.1

同时我删去了代码中所有torch_directml的相关内容
Makefile文件如下:

# CPU镜像
FROM cnstark/pytorch:2.0.0-py3.9.12-ubuntu20.04
# GPU镜像
# FROM cnstark/pytorch:2.0.0-py3.9.12-cuda11.8.0-ubuntu20.04

# 设置工作目录
WORKDIR /home

# 复制当前目录下的所有文件到工作目录
COPY . /home

# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai

# 安装ffmpeg
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg

# 安装可能需要的依赖
RUN python3 -m pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

你好,可以打包分享下镜像吗,纯cpu推理

1.如果你只想要初始化环境,你直接运行我的Dockerfile就可以了,我的Dockerfile只依赖requirements.txt(记得删除torch==2.0.0 和 torchvision==0.15.1)
2.如果你想参考我的代码,你可以参考我的fork https://github.com/wang-zhix/GPT-SoVITS-Server/tree/test-docker
3.使用new_server.py和data/config.json

@mrly2333
Copy link

mrly2333 commented May 6, 2024

我用了pytorch的基础镜像

需要在requirements.txt去掉torch

# torch==2.0.0
# torchvision==0.15.1

同时我删去了代码中所有torch_directml的相关内容
Makefile文件如下:

# CPU镜像
FROM cnstark/pytorch:2.0.0-py3.9.12-ubuntu20.04
# GPU镜像
# FROM cnstark/pytorch:2.0.0-py3.9.12-cuda11.8.0-ubuntu20.04

# 设置工作目录
WORKDIR /home

# 复制当前目录下的所有文件到工作目录
COPY . /home

# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai

# 安装ffmpeg
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg

# 安装可能需要的依赖
RUN python3 -m pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

你好,可以打包分享下镜像吗,纯cpu推理

1.如果你只想要初始化环境,你直接运行我的Dockerfile就可以了,我的Dockerfile只依赖requirements.txt(记得删除torch==2.0.0 和 torchvision==0.15.1) 2.如果你想参考我的代码,你可以参考我的fork https://github.com/wang-zhix/GPT-SoVITS-Server/tree/test-docker 3.使用new_server.py和data/config.json

OSError: libd3d12.so: cannot open shared object file: No such file or directory
遇到了这个报错,按照你的描述构建并运行的

@wang-zhix
Copy link

发一个联系qq 我联系你

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants