Skip to content
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: 2 additions & 1 deletion .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:

- name: Install
env:
VERSION: ${{ inputs.llamacpp_version }}
LLAMA_BUCKET: ${{ vars.HF_REPO }}
LLAMA_VERSION: ${{ inputs.llamacpp_version }}
run: ${{ matrix.install }}

- name: Test
Expand Down
16 changes: 9 additions & 7 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$REPO = "https://huggingface.co/buckets/ggml-org/install.sh/resolve"
if (!$LLAMA_BUCKET) { $LLAMA_BUCKET = $env:LLAMA_BUCKET }
if (!$LLAMA_BUCKET) { $LLAMA_BUCKET = "ggml-org/install.sh" }
$REPO = "https://huggingface.co/buckets/$LLAMA_BUCKET/resolve"

function Die {
param([string[]]$Messages)
Expand All @@ -15,11 +17,11 @@ function Download {
try {
if ($URL -like "*.zst") {
Download "unzstd.exe" "$ARCH/windows/unzstd.exe"
Invoke-RestMethod "$REPO/$VERSION/$URL" -OutFile "$DIR\tmp.zst"
Invoke-RestMethod "$REPO/$LLAMA_VERSION/$URL" -OutFile "$DIR\tmp.zst"
Start-Process -FilePath "$DIR\unzstd.exe" -RedirectStandardInput "$DIR\tmp.zst" -RedirectStandardOutput "$DIR\$FILE" -NoNewWindow -Wait
Remove-Item "$DIR\tmp.zst"
} else {
Invoke-RestMethod "$REPO/$VERSION/$URL" -OutFile "$DIR\$FILE"
Invoke-RestMethod "$REPO/$LLAMA_VERSION/$URL" -OutFile "$DIR\$FILE"
}
} catch {
Die "Failed to download"
Expand Down Expand Up @@ -53,10 +55,10 @@ function Main {
default { Die "Arch not supported" }
}

if (!$VERSION) { $VERSION = $env:VERSION }
if (!$VERSION) { $VERSION = Invoke-RestMethod "$REPO/latest" }
if (!$VERSION) { Die "No version found" }
"Version: $VERSION"
if (!$LLAMA_VERSION) { $LLAMA_VERSION = $env:LLAMA_VERSION }
if (!$LLAMA_VERSION) { $LLAMA_VERSION = Invoke-RestMethod "$REPO/latest" }
if (!$LLAMA_VERSION) { Die "No version found" }
"Version: $LLAMA_VERSION"

$INSTALL_DIR = Join-Path $env:LOCALAPPDATA "Microsoft\WindowsApps"
$DIR = Join-Path $env:TEMP "llama-app-tmp"
Expand Down
13 changes: 7 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
REPO="https://huggingface.co/buckets/ggml-org/install.sh/resolve"
[ "$LLAMA_BUCKET" ] || LLAMA_BUCKET="ggml-org/install.sh"
REPO="https://huggingface.co/buckets/$LLAMA_BUCKET/resolve"

die() {
printf "%s\n" "$@" >&2
Expand All @@ -21,8 +22,8 @@ dl_bin() {
check_bin curl || die "Please install curl"
printf "Downloading %s...\n" "$1"
case "$2" in
(*.zst) curl -fsSL "$REPO/$VERSION/$2" | unzstd ;;
(*) curl -fsSL "$REPO/$VERSION/$2" ;;
(*.zst) curl -fsSL "$REPO/$LLAMA_VERSION/$2" | unzstd ;;
(*) curl -fsSL "$REPO/$LLAMA_VERSION/$2" ;;
esac > "$1.tmp" 2>/dev/null &&
chmod +x "$1.tmp" && mv "$1.tmp" "$1" && return
printf "Failed to download\n" >&2
Expand Down Expand Up @@ -92,9 +93,9 @@ main() {

[ "$HOME" ] || die "No HOME, please check your OS"

[ "$VERSION" ] || VERSION=$(curl -fsSL "$REPO/latest")
[ "$VERSION" ] || die "No version found"
printf "Version: %s\n" "$VERSION"
[ "$LLAMA_VERSION" ] || LLAMA_VERSION=$(curl -fsSL "$REPO/latest")
[ "$LLAMA_VERSION" ] || die "No version found"
printf "Version: %s\n" "$LLAMA_VERSION"

(
rm -rf ~/.llama-app
Expand Down
Loading