forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·36 lines (28 loc) · 1.12 KB
/
install.sh
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
#!/usr/bin/env bash
set -ex
if [ "$FORCE_BUILD" == "on" ]; then
echo "Forcing build of MLC ${MLC_VERSION} (commit=${MLC_COMMIT})"
exit 1
fi
# install the wheels
pip3 install --no-cache-dir --verbose tvm==${TVM_VERSION} mlc-llm==${MLC_VERSION}
pip3 install --no-cache-dir --verbose mlc-chat==${MLC_VERSION} || echo "failed to pip install mlc-chat==${MLC_VERSION} (this is expected for mlc>=0.1.1)"
pip3 install --no-cache-dir --verbose 'pydantic>2'
# we need the source because the MLC model builder relies on it
git clone https://github.com/mlc-ai/mlc-llm /opt/mlc-llm
cd /opt/mlc-llm
git checkout ${MLC_COMMIT}
git submodule update --init --recursive
# apply patches to the source
if [ -s /tmp/mlc/patch.diff ]; then
git apply /tmp/mlc/patch.diff
fi
# add extras to the source
cd /
cp /tmp/mlc/benchmark.py /opt/mlc-llm/
# make the CUTLASS sources available for model builder
ln -s /opt/mlc-llm/3rdparty/tvm/3rdparty /usr/local/lib/python${PYTHON_VERSION}/dist-packages/tvm/3rdparty
# make sure it loads
pip3 show tvm mlc_llm
#python3 -m mlc_llm.build --help
#python3 -c "from mlc_chat import ChatModule; print(ChatModule)"