Skip to content

Commit

Permalink
add github action.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhaode committed Sep 14, 2023
1 parent d06597d commit c137009
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/chatglm_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: chatglm-linux
on:
push:
branches:
- master
- 'feature/**'
paths:
- 'src/**'
- '.github/workflows/chatglm_linux.yml'
pull_request:
branches: [master]
paths:
- 'src/**'
- '.github/workflows/chatglm_linux.yml'

concurrency:
group: linux-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read

jobs:
linux_buil_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: download
run: ./script/download_model.sh chatglm-6b
- name: build
run: ./script/linux_build.sh
- name: test
run: |
cd build
./cli_demo -m ../chatglm-6b
11 changes: 11 additions & 0 deletions script/download_model.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
model=$1
mkdir $model
cd $model
# download models
wget -c https://github.com/wangzhaode/mnn-llm/releases/download/$model-mnn/embedding.mnn
wget -c https://github.com/wangzhaode/mnn-llm/releases/download/$model-mnn/lm.mnn
for i in `seq 0 27`
do
wget -c https://github.com/wangzhaode/mnn-llm/releases/download/$model-mnn/block_$i.mnn
done
cd ..
21 changes: 21 additions & 0 deletions script/linux_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 1. clone MNN
git clone https://github.com/alibaba/MNN.git -b 2.5.0 --depth=1

# 2. build MNN
pushd MNN
mkdir build
pushd build
cmake -DMNN_LOW_MEMORY=ON ..
make -j32
popd
popd

# 3. copy libs
mv MNN/build/libMNN.so MNN/build/express/libMNN_Express.so libs

# 4. build mnn-llm
mkdir build
pushd build
cmake ..
make -j32
popd

0 comments on commit c137009

Please sign in to comment.