Upload 2 files
Browse files- Dockerfile 2.txt +106 -0
- requirements 3.txt +13 -0
Dockerfile 2.txt
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
+
# you will also find guides on how best to write your Dockerfile
|
3 |
+
FROM debian:bullseye-slim
|
4 |
+
ENV NVIDIA_VISIBLE_DEVICES all
|
5 |
+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
|
6 |
+
ENV NVIDIA_REQUIRE_CUDA "cuda>=8.0"
|
7 |
+
ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/targets/x86_64-linux/lib:/usr/local/cuda-11.8/targets/x86_64-linux/include:/usr/local/cuda/include:/usr/local/cuda-11.8:/usr/local/cuda/lib:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
|
8 |
+
#RUN dpkg --add-architecture amd64
|
9 |
+
#RUN apt-get update && \
|
10 |
+
# apt-get install -y --no-install-recommends gnupg2 curl ca-certificates
|
11 |
+
#RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/7fa2af80.pub
|
12 |
+
|
13 |
+
# Import the NVIDIA GPG key
|
14 |
+
RUN apt-get update && apt-get install -y gnupg2 curl
|
15 |
+
#RUN curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/7fa2af80.pub | gpg --dearmor -o /usr/share/keyrings/cuda-archive-keyring.gpg
|
16 |
+
#RUN curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/7fa2af80.pub | gpg --dearmor -o /usr/share/keyrings/cuda-archive-keyring.gpg
|
17 |
+
|
18 |
+
# Add the CUDA repository to sources.list
|
19 |
+
#RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64 /" | tee /etc/apt/sources.list.d/cuda.list
|
20 |
+
#USER root
|
21 |
+
#RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64 /" > /etc/apt/sources.list.d/cuda.list
|
22 |
+
#RUN gpg --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/7fa2af80.pub
|
23 |
+
#RUN aptitude install debian-archive-keyring
|
24 |
+
#RUN apt-get install cuda-archive-keyring
|
25 |
+
# Fetch the NVIDIA repository GPG key
|
26 |
+
#RUN curl -fsSL http://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/7fa2af80.pub | gpg --dearmor -o /usr/share/keyrings/cuda-archive-keyring.gpg
|
27 |
+
|
28 |
+
#RUN gpg --import 7fa2af80.pub
|
29 |
+
# Add the NVIDIA repository and specify the signed-by keyring
|
30 |
+
|
31 |
+
#RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] http://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64 /" > /etc/apt/sources.list.d/cuda.list
|
32 |
+
#RUN apt-get install debian-keyring debian-archive-keyring
|
33 |
+
#RUN apt-key adv --keyserver keyring.debian.com --recv-keys A4B469963BF863CC
|
34 |
+
#RUN wget -qO - https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | apt-key add -
|
35 |
+
#RUN echo "APT::Get::AllowUnauthenticated "true";" | > /etc/apt/apt.conf.d/99-allow-unauthenticated
|
36 |
+
#RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64 /" > /etc/apt/sources.list.d/cuda.list
|
37 |
+
#RUN curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/7fa2af80.pub -o 7fa2af80.pub
|
38 |
+
#RUN gpg --fetch-keys 7fa2af80.pub
|
39 |
+
#RUN gpg --import 7fa2af80.pub
|
40 |
+
#RUN gpg --fetch-keys --keyserver keys.gnupg.net F60F4B3D7FA2AF80
|
41 |
+
#RUN gpg --fetch-keys --keyserver keys.gnupg.net:80
|
42 |
+
#RUN gpg --recv-keys --keyserver keys.gnupg.net F60F4B3D7FA2AF80
|
43 |
+
#RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/7fa2af80.pub
|
44 |
+
#RUN apt-key adv --recv-keys --keyserver keys.gnupg.net F60F4B3D7FA2AF80
|
45 |
+
# Fetch the NVIDIA repository GPG key
|
46 |
+
RUN curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/7fa2af80.pub | gpg --dearmor -o /usr/share/keyrings/cuda-archive-keyring.gpg
|
47 |
+
|
48 |
+
# Add the NVIDIA repository to the APT sources list
|
49 |
+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
|
50 |
+
|
51 |
+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
|
52 |
+
#RUN gpg --list-sigs [email protected]
|
53 |
+
#RUN gpg --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/7fa2af80.pub
|
54 |
+
|
55 |
+
# Update package lists
|
56 |
+
|
57 |
+
|
58 |
+
#RUN apt-get update
|
59 |
+
#RUN gpg --delete-key A4B469963BF863CC
|
60 |
+
|
61 |
+
#RUN echo "deb https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
|
62 |
+
#USER root
|
63 |
+
RUN echo "deb https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64 /" > /etc/apt/sources.list.d/cuda.list
|
64 |
+
|
65 |
+
# Install FFmpeg
|
66 |
+
|
67 |
+
RUN apt-get update && \
|
68 |
+
apt-get install -y python3-pip ffmpeg libcublas-11-8 libcudnn8=8.6.0.163-1+cuda11.8
|
69 |
+
#libcudnn8=8.8.0.121-1+cuda11.8
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
+
# Use the official Python 3.9 image as the base image
|
74 |
+
#FROM python:3.9
|
75 |
+
|
76 |
+
# Set the working directory to /code
|
77 |
+
WORKDIR /app
|
78 |
+
|
79 |
+
# Copy the requirements file into the container at /code/
|
80 |
+
COPY ./requirements.txt /app/requirements.txt
|
81 |
+
# Copy the FastAPI application code into the container
|
82 |
+
COPY ./app.py /app/app.py
|
83 |
+
COPY ./interface.html /app/interface.html
|
84 |
+
COPY ./styles.css /app/styles.css
|
85 |
+
# Install the required Python packages from requirements.txt
|
86 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
87 |
+
|
88 |
+
# Create a non-root user (optional but recommended for security)
|
89 |
+
RUN useradd -m -u 1000 user
|
90 |
+
|
91 |
+
# Switch to the non-root user
|
92 |
+
USER user
|
93 |
+
|
94 |
+
# Define environment variables
|
95 |
+
ENV HOME=/home/user \
|
96 |
+
PATH=/home/user/.local/bin:$PATH
|
97 |
+
|
98 |
+
# Change the working directory to /home/user/app
|
99 |
+
WORKDIR $HOME/app
|
100 |
+
|
101 |
+
# Copy the rest of the application files into the container
|
102 |
+
COPY --chown=user . $HOME/app
|
103 |
+
# Expose port 80 for the FastAPI application
|
104 |
+
EXPOSE 7860
|
105 |
+
# Specify the command to run your application (modify as needed)
|
106 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
requirements 3.txt
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
fastapi==0.74.*
|
2 |
+
requests==2.27.*
|
3 |
+
sentencepiece==0.1.*
|
4 |
+
#torch==1.11.*
|
5 |
+
transformers==4.*
|
6 |
+
uvicorn[standard]==0.17.*
|
7 |
+
piper-tts
|
8 |
+
onnxruntime-gpu
|
9 |
+
#ipywidgets
|
10 |
+
jinja2
|
11 |
+
python-multipart
|
12 |
+
pydub
|
13 |
+
soundfile
|