2023-08-02 18:52:03 +03:00
distributable :
url : https://github.com/oobabooga/text-generation-webui/archive/refs/tags/{{version.tag}}.tar.gz
provides :
- bin/text-generation-webui
versions :
github : oobabooga/text-generation-webui
dependencies :
python.org : ~3.10
2023-10-09 04:35:21 +03:00
pkgx.sh : ^1
2023-08-02 18:52:03 +03:00
2023-10-09 04:35:21 +03:00
entrypoint : pgkx ./entrypoint.sh
2023-08-02 18:52:03 +03:00
2023-08-03 13:46:30 +03:00
display-name : text generation web UI
2023-10-09 04:35:21 +03:00
platforms : darwin
2023-08-02 18:52:03 +03:00
# TODO https://github.com/oobabooga/text-generation-webui/blob/385229313fd728f6e7573895564253d98b9826da/docs/llama.cpp.md?plain=1#L4
# TODO entry
build :
dependencies :
gnu.org/coreutils : '*'
2023-10-09 04:35:21 +03:00
working-directory : text-generation-webui-{{version.raw}}
2023-08-02 18:52:03 +03:00
script :
2023-10-09 04:35:21 +03:00
# pkg expects all the files from its checkout
2023-08-02 18:52:03 +03:00
- |
mkdir -p {{prefix}}/venv/bin
cp -R . {{prefix}}/venv/bin
- working-directory : '{{prefix}}/venv/bin'
2023-10-09 04:35:21 +03:00
run : rm -rf docker .github docs .gitignore *.md
2023-08-02 18:52:03 +03:00
- |
python -m venv {{prefix}}/venv
source {{prefix}}/venv/bin/activate
# these requirements are separate as they vary by platform
- pip install torch torchvision torchaudio
2023-10-09 04:35:21 +03:00
# requirements_apple_intel.txt links to a missing version
# of llama.cpp
- run : |
sed -i.bak -e's/llama_cpp_python-0.2.11-cp310-cp310-macosx_13_0_x86_64.whl/llama_cpp_python-0.2.11-cp310-cp310-macosx_12_0_x86_64.whl/' requirements_apple_intel.txt
rm requirements_apple_intel.txt.bak
if : darwin #/x86-64
- pip install -r $REQS
2023-08-02 18:52:03 +03:00
# pkg expects to be run with CWD set to its checkout
- working-directory : '{{prefix}}/venv/bin'
run : |
echo '#!/usr/bin/env python' > text-generation-webui
echo 'import os' >> text-generation-webui
echo 'os.chdir(os.path.dirname(os.path.abspath(__file__)))' >> text-generation-webui
cat server.py >> text-generation-webui
chmod +x text-generation-webui
rm server.py
- python-venv-stubber.sh text-generation-webui
- cp ../props/entrypoint.sh {{prefix}}
2023-10-09 04:35:21 +03:00
env :
linux :
REQS : requirements.txt
darwin/aarch64 :
REQS : requirements_apple_silicon.txt
darwin/x86-64 :
REQS : requirements_apple_intel.txt
2023-08-02 18:52:03 +03:00
test :
2023-10-09 04:35:21 +03:00
qa-required : true
script : text-generation-webui --help