Skip to content

Commit

Permalink
specifiable release_version
Browse files Browse the repository at this point in the history
  • Loading branch information
okdshin committed Dec 2, 2023
1 parent f475aa7 commit 9422914
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ jobs:
- build: 'openblas'
- build: 'cublas'
steps:
- name: Get Commit ID
id: get_commit_id
run: |
COMMIT_ID=$(echo ${{ github.sha }} | head -c 7)
echo "::set-output name=commit_id::${COMMIT_ID}"
- name: Common dependencies
id: depends
run: |
Expand All @@ -170,7 +176,7 @@ jobs:
- name: Install and test
id: install_and_test
run: |
curl -L https://raw.githubusercontent.com/okdshin/flatline_lsp/main/install.sh | bash -s ${{ matrix.build }}
curl -L https://raw.githubusercontent.com/okdshin/flatline_lsp/main/install.sh | bash -s -- -b ${{ matrix.build }} -r v0.0.0_${{ steps.get_commit_id.outputs.commit_id }}
$HOME/.flatline_lsp/_internal/flatline/backend_server/flatline-server --help
$HOME/.flatline_lsp/flatline_lsp --help
Expand All @@ -183,6 +189,12 @@ jobs:
- build: 'openblas'
- build: 'cublas'
steps:
- name: Get Commit ID
id: get_commit_id
run: |
COMMIT_ID=$(echo ${{ github.sha }} | head -c 7)
echo "::set-output name=commit_id::${COMMIT_ID}"
- name: Common dependencies
id: depends
run: |
Expand All @@ -203,6 +215,6 @@ jobs:
- name: Install and test
id: install_and_test
run: |
curl -L https://raw.githubusercontent.com/okdshin/flatline_lsp/main/install.sh | bash -s ${{ matrix.build }}
curl -L https://raw.githubusercontent.com/okdshin/flatline_lsp/main/install.sh | bash -s -- -b ${{ matrix.build }} -r v0.0.0_${{ steps.get_commit_id.outputs.commit_id }}
$HOME/.flatline_lsp/_internal/flatline/backend_server/flatline-server --help
$HOME/.flatline_lsp/flatline_lsp --help
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://huggingface.co/sokada/codegen25-7b-multi-gguf-with-dummy-tokenizer

## Install

Please choose "openblas" or "cublas" and replace `<release_type>` with it.
Please choose "openblas" or "cublas" and replace `<backend_type>` with it.

- openblas: for CPU, slow
- cublas: for NVIDIA GPU, fast
Expand All @@ -34,9 +34,9 @@ Install CUDA library. See https://developer.nvidia.com/cuda-toolkit
#### Install flatline_lsp

```sh
# This command download `flatline_lsp_ubuntu2004_<release_type>.zip` and unzip it to `$HOME/.flatline_lsp`
# This command download `flatline_lsp_ubuntu2004_<backend_type>.zip` and unzip it to `$HOME/.flatline_lsp`
# then download model data and setup it
curl -L https://raw.githubusercontent.com/okdshin/flatline_lsp/main/install.sh | bash -s <release_type>
curl -L https://raw.githubusercontent.com/okdshin/flatline_lsp/main/install.sh | bash -s -- -b <backend_type>
```

#### Uninstall flatline_lsp
Expand Down
31 changes: 22 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@
set -eu
#set -x

release_version="v0.0.0_08d28ca"
backend_type=""
release_version="v0.0.0_34ca709"

if [ $# -ne 1 ]; then
echo "$0 <openblas or cublas>"
exit 1
fi
help_message="
Usage: ./install.sh [OPTIONS]
Options:
-b, --backend_type Specify backend type (e.g., 'openblas', 'cublas')
-r, --release_version Specify release version (e.g., 'v0.0.0_34ca709')
-h, --help Display this help message and exit
"

release_type=$1
while [[ "$#" -gt 0 ]]; do
case $1 in
-b|--backend_type) backend_type="$2"; shift ;;
-r|--release_version) release_version="$2"; shift ;;
-h|--help) echo "$help_message"; exit 0 ;;
*) echo "Error: Unknown option $1"; exit 1 ;;
esac
shift
done

target_dir="$HOME/.flatline_lsp"
if [ -d "$target_dir" ]; then
Expand All @@ -28,14 +41,14 @@ trap 'cleanup' EXIT
cd "$tmp_dir"

echo "Download release..."
if [ "$release_type" == "openblas" ]; then
if [ "$backend_type" == "openblas" ]; then
curl -L -o flatline_lsp.zip \
"https://github.com/okdshin/flatline_lsp/releases/download/${release_version}/flatline_lsp_ubuntu2004_openblas.zip"
elif [ "$release_type" == "cublas" ]; then
elif [ "$backend_type" == "cublas" ]; then
curl -L -o flatline_lsp.zip \
"https://github.com/okdshin/flatline_lsp/releases/download/${release_version}/flatline_lsp_ubuntu2004_cublas.zip"
else
echo "$release_type is not supported. Please specify 'openblas' or 'cublas'"
echo "$backend_type is not supported. Please specify 'openblas' or 'cublas'"
exit 1
fi
unzip flatline_lsp.zip > /dev/null
Expand Down

0 comments on commit 9422914

Please sign in to comment.