Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
6b225ba
1
Parent(s):
301d71a
let's switch back to CPU, it's the only thing that works
Browse files- Dockerfile +15 -67
- Dockerfile.cpu +29 -0
- Dockerfile.gpu +81 -0
Dockerfile
CHANGED
@@ -1,81 +1,29 @@
|
|
1 |
-
FROM
|
2 |
-
LABEL maintainer="Hugging Face"
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
ARG DEBIAN_FRONTEND=noninteractive
|
9 |
-
|
10 |
-
# Use login shell to read variables from `~/.profile` (to pass dynamic created variables between RUN commands)
|
11 |
-
SHELL ["sh", "-lc"]
|
12 |
-
|
13 |
-
RUN apt update
|
14 |
-
|
15 |
-
RUN apt --yes install build-essential
|
16 |
-
|
17 |
-
RUN apt --yes install curl
|
18 |
-
|
19 |
-
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
20 |
-
|
21 |
-
RUN apt --yes install nodejs
|
22 |
-
|
23 |
-
# we need Rust
|
24 |
-
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
|
25 |
-
|
26 |
-
# configure PNPM
|
27 |
-
|
28 |
-
RUN corepack enable
|
29 |
-
RUN corepack prepare [email protected] --activate
|
30 |
-
|
31 |
-
RUN apt --yes install git git-lfs libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg
|
32 |
-
|
33 |
-
RUN git lfs install
|
34 |
-
|
35 |
-
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
36 |
-
|
37 |
-
WORKDIR /tmp
|
38 |
-
|
39 |
-
# ok! let's try to compile llama-node
|
40 |
-
RUN git clone https://github.com/Atome-FE/llama-node.git
|
41 |
-
|
42 |
-
WORKDIR /tmp/llama-node
|
43 |
-
|
44 |
-
RUN git submodule update --init --recursive
|
45 |
-
|
46 |
-
RUN pnpm install --ignore-scripts
|
47 |
-
|
48 |
-
# let's try to build backends, to see
|
49 |
-
RUN pnpm build:llama-cpp
|
50 |
-
|
51 |
-
RUN pnpm:build
|
52 |
-
|
53 |
-
WORKDIR /tmp/llama-node/packages/llama-cpp
|
54 |
-
|
55 |
-
RUN pnpm build:cuda
|
56 |
-
|
57 |
-
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$HOME/.llama-node
|
58 |
-
|
59 |
-
RUN useradd -m -u 1000 user
|
60 |
USER user
|
|
|
|
|
61 |
ENV HOME=/home/user \
|
62 |
PATH=/home/user/.local/bin:$PATH
|
63 |
|
|
|
64 |
WORKDIR $HOME/app
|
65 |
|
66 |
-
#
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
|
71 |
RUN npm install
|
72 |
|
73 |
-
#
|
74 |
-
|
75 |
-
COPY --chown=user . .
|
76 |
|
77 |
ADD --chown=user https://huggingface.co/TheBloke/airoboros-13b-gpt4-GGML/resolve/main/airoboros-13b-gpt4.ggmlv3.q4_0.bin models/airoboros-13b-gpt4.ggmlv3.q4_0.bin
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
CMD [ "pnpm", "run", "start" ]
|
|
|
1 |
+
FROM node:18
|
|
|
2 |
|
3 |
+
# Set up a new user named "user" with user ID 1000
|
4 |
+
RUN useradd -o -u 1000 user
|
5 |
|
6 |
+
# Switch to the "user" user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
USER user
|
8 |
+
|
9 |
+
# Set home to the user's home directory
|
10 |
ENV HOME=/home/user \
|
11 |
PATH=/home/user/.local/bin:$PATH
|
12 |
|
13 |
+
# Set the working directory to the user's home directory
|
14 |
WORKDIR $HOME/app
|
15 |
|
16 |
+
# Install app dependencies
|
17 |
+
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
18 |
+
# where available (npm@5+)
|
19 |
+
COPY --chown=user package*.json $HOME/app
|
20 |
|
21 |
RUN npm install
|
22 |
|
23 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
24 |
+
COPY --chown=user . $HOME/app
|
|
|
25 |
|
26 |
ADD --chown=user https://huggingface.co/TheBloke/airoboros-13b-gpt4-GGML/resolve/main/airoboros-13b-gpt4.ggmlv3.q4_0.bin models/airoboros-13b-gpt4.ggmlv3.q4_0.bin
|
27 |
|
28 |
+
EXPOSE 7860
|
29 |
+
CMD [ "npm", "run", "start" ]
|
|
Dockerfile.cpu
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM node:18
|
2 |
+
|
3 |
+
# Set up a new user named "user" with user ID 1000
|
4 |
+
RUN useradd -o -u 1000 user
|
5 |
+
|
6 |
+
# Switch to the "user" user
|
7 |
+
USER user
|
8 |
+
|
9 |
+
# Set home to the user's home directory
|
10 |
+
ENV HOME=/home/user \
|
11 |
+
PATH=/home/user/.local/bin:$PATH
|
12 |
+
|
13 |
+
# Set the working directory to the user's home directory
|
14 |
+
WORKDIR $HOME/app
|
15 |
+
|
16 |
+
# Install app dependencies
|
17 |
+
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
18 |
+
# where available (npm@5+)
|
19 |
+
COPY --chown=user package*.json $HOME/app
|
20 |
+
|
21 |
+
RUN npm install
|
22 |
+
|
23 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
24 |
+
COPY --chown=user . $HOME/app
|
25 |
+
|
26 |
+
ADD --chown=user https://huggingface.co/TheBloke/airoboros-13b-gpt4-GGML/resolve/main/airoboros-13b-gpt4.ggmlv3.q4_0.bin models/airoboros-13b-gpt4.ggmlv3.q4_0.bin
|
27 |
+
|
28 |
+
EXPOSE 7860
|
29 |
+
CMD [ "npm", "run", "start" ]
|
Dockerfile.gpu
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
|
2 |
+
LABEL maintainer="Hugging Face"
|
3 |
+
|
4 |
+
ENV PYTHONUNBUFFERED 1
|
5 |
+
|
6 |
+
EXPOSE 7860
|
7 |
+
|
8 |
+
ARG DEBIAN_FRONTEND=noninteractive
|
9 |
+
|
10 |
+
# Use login shell to read variables from `~/.profile` (to pass dynamic created variables between RUN commands)
|
11 |
+
SHELL ["sh", "-lc"]
|
12 |
+
|
13 |
+
RUN apt update
|
14 |
+
|
15 |
+
RUN apt --yes install build-essential
|
16 |
+
|
17 |
+
RUN apt --yes install curl
|
18 |
+
|
19 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
20 |
+
|
21 |
+
RUN apt --yes install nodejs
|
22 |
+
|
23 |
+
# we need Rust
|
24 |
+
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
|
25 |
+
|
26 |
+
# configure PNPM
|
27 |
+
|
28 |
+
RUN corepack enable
|
29 |
+
RUN corepack prepare [email protected] --activate
|
30 |
+
|
31 |
+
RUN apt --yes install git git-lfs libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg
|
32 |
+
|
33 |
+
RUN git lfs install
|
34 |
+
|
35 |
+
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
36 |
+
|
37 |
+
WORKDIR /tmp
|
38 |
+
|
39 |
+
# ok! let's try to compile llama-node
|
40 |
+
RUN git clone https://github.com/Atome-FE/llama-node.git
|
41 |
+
|
42 |
+
WORKDIR /tmp/llama-node
|
43 |
+
|
44 |
+
RUN git submodule update --init --recursive
|
45 |
+
|
46 |
+
RUN pnpm install --ignore-scripts
|
47 |
+
|
48 |
+
# let's try to build backends, to see
|
49 |
+
RUN pnpm build:llama-cpp
|
50 |
+
|
51 |
+
RUN pnpm:build
|
52 |
+
|
53 |
+
WORKDIR /tmp/llama-node/packages/llama-cpp
|
54 |
+
|
55 |
+
RUN pnpm build:cuda
|
56 |
+
|
57 |
+
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$HOME/.llama-node
|
58 |
+
|
59 |
+
RUN useradd -m -u 1000 user
|
60 |
+
USER user
|
61 |
+
ENV HOME=/home/user \
|
62 |
+
PATH=/home/user/.local/bin:$PATH
|
63 |
+
|
64 |
+
WORKDIR $HOME/app
|
65 |
+
|
66 |
+
# prepare to install the Node app
|
67 |
+
COPY --chown=user package*.json .
|
68 |
+
|
69 |
+
RUN pnpm --version
|
70 |
+
|
71 |
+
RUN npm install
|
72 |
+
|
73 |
+
# ok.. should be good?
|
74 |
+
|
75 |
+
COPY --chown=user . .
|
76 |
+
|
77 |
+
ADD --chown=user https://huggingface.co/TheBloke/airoboros-13b-gpt4-GGML/resolve/main/airoboros-13b-gpt4.ggmlv3.q4_0.bin models/airoboros-13b-gpt4.ggmlv3.q4_0.bin
|
78 |
+
|
79 |
+
RUN python3 test.py
|
80 |
+
|
81 |
+
CMD [ "pnpm", "run", "start" ]
|