diff --git a/.github/actions/prepare-llm/action.yml b/.github/actions/prepare-llm/action.yml index 1572c15..daff0ab 100644 --- a/.github/actions/prepare-llm/action.yml +++ b/.github/actions/prepare-llm/action.yml @@ -1,19 +1,23 @@ -name: Prepare llama.cpp and Phi 2 -description: Build llama.cpp and load Phi 2 +name: Prepare Phi 2 +description: Download Phi 2 and launch it runs: using: "composite" steps: - - name: Get and build llama.cpp - shell: bash - run: | - git clone https://github.com/ggerganov/llama.cpp.git - cd llama.cpp - make server - - name: Download Phi 2 model shell: bash run: curl -OL https://huggingface.co/TheBloke/dolphin-2_6-phi-2-GGUF/resolve/main/dolphin-2_6-phi-2.Q3_K_M.gguf - - name: Run llama.cpp with Phi 2 + - name: Setup binfmt with APE shell: bash - run: ./llama.cpp/server --host 0.0.0.0 -m ./dolphin-2_6-phi-2.Q3_K_M.gguf & + run: | + sudo wget -O /usr/bin/ape https://cosmo.zip/pub/cosmos/bin/ape-$(uname -m).elf + sudo chmod +x /usr/bin/ape + sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register" + sudo sh -c "echo ':APE-jart:M::jartsr::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register" + + - name: Run Phi 2 with Llamafile + shell: bash + run: | + curl -OL https://github.com/Mozilla-Ocho/llamafile/releases/download/0.6.2/llamafile-0.6.2.zip + unzip llamafile-0.6.2.zip + ./llamafile-0.6.2/bin/llamafile -m ./dolphin-2_6-phi-2.Q3_K_M.gguf &