NullVoider commited on
Commit
8974747
Β·
verified Β·
1 Parent(s): ed39683

Delete scripts/setup-mac15.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/setup-mac15.sh +0 -93
scripts/setup-mac15.sh DELETED
@@ -1,93 +0,0 @@
1
- #!/bin/bash
2
- # =============================================================================
3
- # setup-mac15.sh
4
- # One-command clone + automatic download of mac15.qcow2 into mac15-image/
5
- # =============================================================================
6
-
7
- set -e # Exit immediately if any command fails
8
-
9
- GITHUB_REPO="https://github.com/nullvoider07/mac15-base"
10
- REPO_NAME=$(basename "$GITHUB_REPO")
11
-
12
- echo "πŸš€ Cloning GitHub repo: $GITHUB_REPO"
13
-
14
- # ----------------------------- Clone with GitHub CLI -----------------------
15
- echo "πŸ”§ Checking GitHub CLI..."
16
-
17
- if ! command -v gh >/dev/null 2>&1; then
18
- echo " GitHub CLI not found. Attempting to install..."
19
-
20
- # Try Homebrew (macOS/Linux)
21
- if command -v brew >/dev/null 2>&1; then
22
- brew install gh
23
- # Try APT (Debian/Ubuntu)
24
- elif command -v apt-get >/dev/null 2>&1; then
25
- curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
26
- sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \
27
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
28
- sudo apt-get update && sudo apt-get install gh -y
29
- else
30
- echo "❌ Unsupported package manager. Please install GitHub CLI manually:"
31
- echo " https://cli.github.com"
32
- exit 1
33
- fi
34
- else
35
- echo " βœ… GitHub CLI already available."
36
- fi
37
-
38
- gh repo clone "$GITHUB_REPO" "$REPO_NAME" -- --depth=1
39
-
40
- # ----------------------------- Create folder -------------------------------
41
- echo "πŸ“ Creating folder: mac15-image/"
42
- mkdir -p "$REPO_NAME/mac15-image"
43
-
44
- # ----------------------------- Ensure uv is available ---------------------
45
- echo "πŸ”§ Checking uv..."
46
-
47
- if command -v uv >/dev/null 2>&1; then
48
- echo " uv already available β€” skipping installation."
49
- else
50
- echo " Installing uv package manager..."
51
- curl -LsSf https://astral.sh/uv/install.sh | sh
52
- export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH"
53
- hash -r
54
- fi
55
-
56
- # ----------------------------- Ephemeral venv for huggingface-cli ----------
57
- # Create a temporary venv, install huggingface-hub into it, run the download,
58
- # then delete the venv. This avoids all PATH/hash-cache/interpreter-mismatch
59
- # issues caused by stale system-wide or tool-level installs.
60
- echo "πŸ”§ Creating ephemeral venv for huggingface-cli..."
61
-
62
- HF_VENV="$(mktemp -d)/hf-venv"
63
-
64
- # uv venv picks the correct current Python automatically
65
- uv venv "$HF_VENV" --quiet
66
-
67
- # Install directly into the venv β€” no --system, no activation needed
68
- uv pip install --python "$HF_VENV/bin/python" transformers --quiet
69
-
70
- echo " βœ… huggingface-hub installed in ephemeral venv."
71
-
72
- # ----------------------------- Download QCOW2 ------------------------------
73
- echo "πŸ“₯ Downloading mac15.qcow2 (large file) into $REPO_NAME/mac15-image/ ..."
74
- echo " (This may take a while β€” progress bar will show)"
75
-
76
- # Call huggingface-cli directly by its venv path β€” no PATH lookup, no cache
77
- "$HF_VENV/bin/hf" download NullVoider/mac15-base base.dmg \
78
- --local-dir "$REPO_NAME/mac15-image"
79
-
80
- "$HF_VENV/bin/hf" download NullVoider/mac15-base mac15.qcow2 \
81
- --local-dir "$REPO_NAME/mac15-image"
82
-
83
- # ----------------------------- Cleanup venv --------------------------------
84
- echo "🧹 Cleaning up ephemeral venv..."
85
- rm -rf "$HF_VENV"
86
-
87
- # ----------------------------- Final message -------------------------------
88
- echo ""
89
- echo "βœ… SUCCESS!"
90
- echo " Repository cloned β†’ $REPO_NAME/"
91
- echo " QCOW2 image ready at: $REPO_NAME/mac15-image/mac15.qcow2"
92
- echo ""
93
- echo " Next time just run: cd $REPO_NAME && git pull"