Skip to content

Commit

Permalink
Refactor (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha0552 authored Apr 9, 2024
1 parent e0f9138 commit 9c1085e
Show file tree
Hide file tree
Showing 24 changed files with 95 additions and 126 deletions.
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ work/

# rendered files
airootfs/root/customize_airootfs.sh
airootfs/root/customize_airootfs/scripts/0100-automatic-patches.sh
airootfs/root/customize_airootfs/scripts/0100-koboldcpp-patches.sh
airootfs/root/customize_airootfs/scripts/1000-automatic-dependencies.sh
airootfs/root/customize_airootfs/scripts/1000-axolotl-dependencies.sh
airootfs/root/customize_airootfs/scripts/1000-automatic.sh
airootfs/root/customize_airootfs/scripts/1000-axolotl.sh
airootfs/root/customize_airootfs/scripts/1000-comfyui-dependencies.sh
airootfs/root/customize_airootfs/scripts/1000-koboldcpp.sh
airootfs/root/customize_airootfs/scripts/1000-llamacpp.sh
airootfs/root/customize_airootfs/scripts/1000-sillytavern-extras-dependencies.sh
airootfs/root/customize_airootfs/scripts/1000-text-generation-webui-dependencies.sh
airootfs/root/customize_airootfs/scripts/1000-vllm-dependencies.sh
airootfs/root/customize_airootfs/scripts/9999-cleanup.sh
packages.x86_64
profiledef.sh
31 changes: 0 additions & 31 deletions .gitmodules

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ LiveCD distribution based on [ArchLinux](https://archlinux.org/) and currently i
* [llama.cpp](https://github.com/ggerganov/llama.cpp)
* [SillyTavern-Extras](https://github.com/SillyTavern/SillyTavern-Extras)
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
* [vllm](https://github.com/vllm-project/vllm)

If you would like to see another AI-related project included in ToriLinux, please open an [issue](https://github.com/sasha0552/ToriLinux/issues/new).

Expand All @@ -32,6 +31,5 @@ Note that you need pre-downloaded models on a local hard drive or NFS server, or

Note that following projects is not available on ROCm version:
* [axolotl](https://github.com/OpenAccess-AI-Collective/axolotl)
* [vllm](https://github.com/vllm-project/vllm)

The server for building the ROCm version is provided by [@Sepera-okeq](https://github.com/Sepera-okeq/).
1 change: 0 additions & 1 deletion airootfs/home/tori/ComfyUI
Submodule ComfyUI deleted from c6de09
1 change: 0 additions & 1 deletion airootfs/home/tori/SillyTavern-Extras
Submodule SillyTavern-Extras deleted from 5b35e9
1 change: 0 additions & 1 deletion airootfs/home/tori/automatic
Submodule automatic deleted from 82973c
1 change: 0 additions & 1 deletion airootfs/home/tori/axolotl
Submodule axolotl deleted from ff939d
1 change: 0 additions & 1 deletion airootfs/home/tori/koboldcpp
Submodule koboldcpp deleted from f3b765
1 change: 0 additions & 1 deletion airootfs/home/tori/llama.cpp
Submodule llama.cpp deleted from b06c16
1 change: 0 additions & 1 deletion airootfs/home/tori/text-generation-webui
Submodule text-generation-webui deleted from 7cf140
1 change: 0 additions & 1 deletion airootfs/home/tori/vllm
Submodule vllm deleted from f408d0

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#!/bin/bash
set -eu

# clone repository
git clone "https://github.com/vladmandic/automatic.git"

# automatic patches
pushd "automatic"
# use specific revision
git checkout e783b098fd0ad28acabb29844ab0af0978684c04

# clone submodules
git submodule update --init --recursive

# remove git dependency
sed -i '/installer.check_modified_files()/d' launch.py
sed -i '/installer.install_submodules()/d' launch.py
Expand All @@ -19,3 +28,29 @@ pushd "automatic"
patch -p1 < "$CUSTOMIZE_AIROOTFS/patches/0000-automatic-drop-pstate-in-idle.patch"
{% endif %}
popd

# automatic dependencies
pushd "automatic"
# disable package caching
export PIP_NO_CACHE_DIR=0

# create venv
python3 -m venv venv

# activate venv
source venv/bin/activate
{% if platform == "cuda" %}
# install nvidia-pstate if cuda
pip3 install nvidia-pstate
{% endif %}

# install dependencies
python3 launch.py --test
deactivate

# remove installation config
rm config.json

# remove installation log
rm sdnext.log
popd
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#!/bin/bash
set -eu

{% if platform == "cuda" %}
# clone repository
git clone "https://github.com/OpenAccess-AI-Collective/axolotl.git"

# axolotl patches
pushd "axolotl"
# use specific revision
git checkout 2fa65b95997fa0ae68ae2b66933521ff8dfa3980
popd

# axolotl dependencies
pushd "axolotl"
{% if platform == "cuda" %}
# disable package caching
export PIP_NO_CACHE_DIR=0

Expand Down Expand Up @@ -35,5 +44,5 @@ pushd "axolotl"
# downgrade flash-attn (https://github.com/OpenAccess-AI-Collective/axolotl/issues/911#issuecomment-1868546443)
pip3 install flash-attn==2.3.2
deactivate
{% endif %}
popd
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
set -eu

# clone repository
git clone "https://github.com/comfyanonymous/ComfyUI.git"

# ComfyUI patches
pushd "ComfyUI"
# use specific revision
git checkout 30abc324c2f73e6b648093ccd4741dece20be1e5
popd

# ComfyUI dependencies
pushd "ComfyUI"
# disable package caching
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash
#!/bin/sh
set -eu

# clone repository
git clone "https://github.com/LostRuins/koboldcpp.git"

# koboldcpp patches
pushd "koboldcpp"
# use specific revision
git checkout f3b7651102c3ce3e4f331b93137dc32d752eada0

{% if platform == "cuda" %}
# drop pstate in idle
patch -p1 < "$CUSTOMIZE_AIROOTFS/patches/0000-koboldcpp-drop-pstate-in-idle.patch"
Expand Down
11 changes: 11 additions & 0 deletions airootfs/root/customize_airootfs/scripts/1000-llamacpp.sh.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -eu

# clone repository
git clone "https://github.com/ggerganov/llama.cpp.git"

# llama.cpp patches
pushd "llama.cpp"
# use specific revision
git checkout cc4a95426d17417d3c83f12bdb514fbe8abe2a88
popd
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
set -eu

# clone repository
git clone "https://github.com/SillyTavern/SillyTavern-Extras.git"

# SillyTavern-Extras patches
pushd "SillyTavern-Extras"
# use specific revision
git checkout 86793c6e104ce7e69da919eecea7f4d87ed61727
popd

# SillyTavern-Extras dependencies
pushd "SillyTavern-Extras"
# disable package caching
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
set -eu

# clone repository
git clone "https://github.com/oobabooga/text-generation-webui.git"

# text-generation-webui patches
pushd "text-generation-webui"
# use specific revision
git checkout 91a7370a655881c55274284509a546ffd644dc16
popd

# text-generation-webui dependencies
pushd "text-generation-webui"
# disable package caching
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,3 @@ rm -fr /home/tori/.config/matplotlib

# keras
rm -fr /home/tori/.keras

{% if platform == "rocm" %}
# remove axolotl if rocm
rm -fr /home/tori/axolotl

# remove vllm if rocm
rm -fr /home/tori/vllm
{% endif %}

0 comments on commit 9c1085e

Please sign in to comment.