Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -11
Dockerfile
CHANGED
@@ -1,15 +1,22 @@
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
6 |
|
|
|
|
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
9 |
-
|
|
|
10 |
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
# Set up a new user named "user" with user ID 1000
|
15 |
RUN useradd -m -u 1000 user
|
@@ -27,9 +34,4 @@ WORKDIR $HOME/app
|
|
27 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
28 |
COPY --chown=user . $HOME/app
|
29 |
|
30 |
-
RUN pip install --upgrade bitsandbytes
|
31 |
-
RUN rm -rf /usr/local/lib/python3.9/site-packages/bitsandbytes && \
|
32 |
-
pip install --no-cache-dir --force-reinstall --upgrade bitsandbytes
|
33 |
-
RUN pip install accelerate
|
34 |
-
|
35 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
# Install dependencies for building SentencePiece
|
4 |
+
RUN apt-get update && \
|
5 |
+
apt-get install -y protobuf-compiler libprotobuf-dev cmake zlib1g-dev git wget && \
|
6 |
+
rm -rf /var/lib/apt/lists/*
|
7 |
|
8 |
+
WORKDIR /code
|
9 |
+
COPY requirements.txt /code/requirements.txt
|
10 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
11 |
|
12 |
+
# Copy only the source code after installing the dependencies
|
13 |
+
COPY . /code
|
14 |
|
15 |
+
# Upgrade bitsandbytes
|
16 |
+
RUN pip install --no-cache-dir --force-reinstall --upgrade bitsandbytes
|
17 |
+
|
18 |
+
# Install accelerate
|
19 |
+
RUN pip install accelerate
|
20 |
|
21 |
# Set up a new user named "user" with user ID 1000
|
22 |
RUN useradd -m -u 1000 user
|
|
|
34 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
35 |
COPY --chown=user . $HOME/app
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|