forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (43 loc) · 1.45 KB
/
Dockerfile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#---
# name: minigpt4
# group: vlm
# config: config.py
# depends: [pytorch, torchvision, huggingface_hub]
# requires: '>=34.1.0'
# test: test.sh
# docs: docs.md
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
WORKDIR /opt
# upgrade toolchain to g++-10 for --std=c++2a
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc-10 \
g++-10 \
time \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
ARG CC=/usr/bin/gcc-10
ARG CXX=/usr/bin/g++-10
ARG CUDA_ARCHITECTURES
ARG MINIGPT4_CPP_REPO=Maknee/minigpt4.cpp
ARG MINIGPT4_CPP_BRANCH=master
COPY patch.*.diff /tmp/
ADD https://api.github.com/repos/${MINIGPT4_CPP_REPO}/git/refs/heads/${MINIGPT4_CPP_BRANCH} /tmp/minigpt4_cpp_version.json
RUN git clone --branch=${MINIGPT4_CPP_BRANCH} --depth=1 --recursive https://github.com/${MINIGPT4_CPP_REPO} && \
cd minigpt4.cpp && \
git apply /tmp/patch.minigpt4.diff && \
git status && \
mkdir build && \
cd build && \
cmake -DMINIGPT4_CUBLAS=ON -DMINIGPT4_CUDA_FP16=ON -DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHITECTURES} ../
#RUN cd minigpt4.cpp/build/_deps/llama_cpp-src && \
# git apply /tmp/patch.llamacpp.diff && \
# git status
RUN cd minigpt4.cpp/build && \
cmake --build . --config Release --parallel $(nproc)
RUN pip3 install --no-cache-dir --verbose -r minigpt4.cpp/minigpt4/requirements.txt
RUN pip3 install --no-cache-dir --verbose gradio==3.38.0
COPY benchmark.py minigpt4.cpp/minigpt4/
WORKDIR /