File size: 1,631 Bytes
0cdcdb2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
07a5fb4
0cdcdb2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM ubuntu:20.04
EXPOSE 7860
RUN apt update
RUN apt install -y python3 python3-pip libsndfile1 wget

# From https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html  - step 1
RUN mkdir --parents --mode=0755 /etc/apt/keyrings
RUN wget https://repo.radeon.com/rocm/rocm.gpg.key -O /tmp/key
RUN gpg --dearmor /tmp/key
RUN cp /tmp/key.gpg /etc/apt/keyrings/rocm.gpg

# From https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html  - step 3 - Note using 5.6.1 here
RUN echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/5.6.1 focal main" | tee --append /etc/apt/sources.list.d/rocm.list
RUN echo "Package: *" | tee /etc/apt/preferences.d/rocm-pin-600
RUN echo "Pin: release o=repo.radeon.com" | tee --append /etc/apt/preferences.d/rocm-pin-600
RUN echo "Pin-Priority: 600" | tee --append /etc/apt/preferences.d/rocm-pin-600
RUN apt update

# From https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html  - step 4
RUN apt install -y rocm-hip-sdk

COPY ./tortoise-tts /app

# These are probably not needed
ENV HOME "/root"
#ENV CONDA_DIR "${HOME}/miniconda"
#ENV PATH="$CONDA_DIR/bin":$PATH
#ENV CONDA_AUTO_UPDATE_CONDA=false
ENV PIP_DOWNLOAD_CACHE="$HOME/.pip/cache"
ENV TORTOISE_MODELS_DIR="$HOME/tortoise-tts/build/lib/tortoise/models"

WORKDIR /app

RUN python3 -m pip install -r ./requirements.txt

# I could probalby change the requirements.txt to install these in one go, but this works
RUN pip3 uninstall torch torchaudio -y
RUN pip3 install torch torchaudio --index-url https://download.pytorch.org/whl/rocm5.2
RUN python3 setup.py install