diff --git a/projects/github.com/oobabooga/text-generation-webui/entrypoint.sh b/projects/github.com/oobabooga/text-generation-webui/entrypoint.sh index 06817fa0..5827d452 100644 --- a/projects/github.com/oobabooga/text-generation-webui/entrypoint.sh +++ b/projects/github.com/oobabooga/text-generation-webui/entrypoint.sh @@ -1,10 +1,11 @@ -#!/usr/bin/env -S tea bash +#!/usr/bin/env -S pkgx bash +# shellcheck shell=bash -PORT=$(tea get-port) +PORT=$(pkgx get-port) set -emfo pipefail -tea gum format <&2 +# shellcheck disable=SC2154 +if test -n "$pkgx_GUI"; then + echo "{\"xyz.pkgx\":{\"gui\":\"http://127.0.0.1:$PORT\"}}" >&2 else open "http://127.0.0.1:$PORT" fi -tea gum format < bugs reports to our [tracker](https://github.com/teaxyz/pantry/issues). thanks! +> bugs reports to our [tracker](https://github.com/pkgxxyz/pantry/issues). thanks! enjoy! EoMD diff --git a/projects/github.com/oobabooga/text-generation-webui/package.yml b/projects/github.com/oobabooga/text-generation-webui/package.yml index d0a17dd7..10179137 100644 --- a/projects/github.com/oobabooga/text-generation-webui/package.yml +++ b/projects/github.com/oobabooga/text-generation-webui/package.yml @@ -9,30 +9,27 @@ versions: dependencies: python.org: ~3.10 - tea.xyz: ^0 + pkgx.sh: ^1 -entrypoint: tea ./entrypoint.sh +entrypoint: pgkx ./entrypoint.sh display-name: text generation web UI -platforms: - darwin +platforms: darwin # TODO https://github.com/oobabooga/text-generation-webui/blob/385229313fd728f6e7573895564253d98b9826da/docs/llama.cpp.md?plain=1#L4 # TODO entry build: dependencies: gnu.org/coreutils: '*' - working-directory: - text-generation-webui-{{version.raw}} + working-directory: text-generation-webui-{{version.raw}} script: - # pkg expects all the files from its checkout + # pkg expects all the files from its checkout - | mkdir -p {{prefix}}/venv/bin cp -R . {{prefix}}/venv/bin - working-directory: '{{prefix}}/venv/bin' - run: - rm -rf docker .github docs .gitignore *.md + run: rm -rf docker .github docs .gitignore *.md - | python -m venv {{prefix}}/venv @@ -41,7 +38,13 @@ build: # these requirements are separate as they vary by platform - pip install torch torchvision torchaudio - - pip install -r requirements.txt + # 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 # pkg expects to be run with CWD set to its checkout - working-directory: '{{prefix}}/venv/bin' @@ -56,6 +59,14 @@ build: - python-venv-stubber.sh text-generation-webui - cp ../props/entrypoint.sh {{prefix}} + env: + linux: + REQS: requirements.txt + darwin/aarch64: + REQS: requirements_apple_silicon.txt + darwin/x86-64: + REQS: requirements_apple_intel.txt test: - text-generation-webui --help + qa-required: true + script: text-generation-webui --help