Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

koboldcpp.sh - The Mamba Multitool #554

Merged
merged 11 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,8 @@ hipblas.dll
koboldcpp_hipblas.so
koboldcpp_hipblas.dll

bin/
conda/

# Jetbrains idea folder
.idea/
24 changes: 24 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: koboldcpp
channels:
- nvidia/label/cuda-11.5.0
- conda-forge
- defaults
dependencies:
- python=3.8
- cuda-nvcc=11.5
- cuda-libraries-dev=11.5
- cxx-compiler
- gxx=10
- pip
- git=2.35.1
- libopenblas
- openblas
- clblast
- ninja
- make
- packaging
- pyinstaller
- libcblas
- ocl-icd-system
- pip:
- customtkinter
22 changes: 22 additions & 0 deletions koboldcpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
if [ ! -f "bin/micromamba" ]; then
curl -Ls https://anaconda.org/conda-forge/micromamba/1.5.3/download/linux-64/micromamba-1.5.3-0.tar.bz2 | tar -xvj bin/micromamba
fi

if [[ ! -f "conda/envs/linux/bin/python" || $1 == "rebuild" ]]; then
bin/micromamba create --no-shortcuts -r conda -n linux -f environment.yaml -y
bin/micromamba create --no-shortcuts -r conda -n linux -f environment.yaml -y
bin/micromamba run -r conda -n linux make clean
fi

bin/micromamba run -r conda -n linux make LLAMA_OPENBLAS=1 LLAMA_CLBLAST=1 LLAMA_CUBLAS=1 LLAMA_PORTABLE=1

if [[ $1 == "rebuild" ]]; then
echo Rebuild complete, you can now try to launch Koboldcpp.
elif [[ $1 == "dist" ]]; then
bin/micromamba remove -r conda -n linux --force ocl-icd -y
bin/micromamba run -r conda -n linux pyinstaller --noconfirm --onefile --collect-all customtkinter --add-data='./koboldcpp_default.so:.' --add-data='./koboldcpp_cublas.so:.' --add-data='./koboldcpp_openblas.so:.' --add-data='./koboldcpp_clblast.so:.' --add-data='./koboldcpp_clblast_noavx2.so:.' --add-data='./klite.embd:.' --add-data='./kcpp_docs.embd:.' --add-data='./rwkv_vocab.embd:.' --add-data='./rwkv_world_vocab.embd:.' --clean --console koboldcpp.py -n "koboldcpp-linux-x64"
bin/micromamba install -r conda -n linux ocl-icd -c conda-forge -y
else
bin/micromamba run -r conda -n linux python koboldcpp.py $*
fi