Created
April 6, 2026 13:44
-
-
Save michaelgold/009895246b54694e20408e89d42cd817 to your computer and use it in GitHub Desktop.
Ostris AI Toolkit Volume Init for Runpod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| echo "Runpod init starting..." | |
| # Create persistent dirs | |
| mkdir -p /mnt/{datasets,models,output,configs,hf,cache} | |
| link_dir () { | |
| TARGET=$1 | |
| LINK=$2 | |
| if [ -L "$LINK" ]; then | |
| rm "$LINK" | |
| elif [ -e "$LINK" ]; then | |
| rm -rf "$LINK" | |
| fi | |
| ln -s "$TARGET" "$LINK" | |
| } | |
| # Link ai-toolkit dirs | |
| link_dir /mnt/datasets /app/ai-toolkit/datasets | |
| link_dir /mnt/models /app/ai-toolkit/models | |
| link_dir /mnt/output /app/ai-toolkit/output | |
| link_dir /mnt/configs /app/ai-toolkit/configs | |
| # Cache persistence (huge speed win) | |
| link_dir /mnt/hf /root/.cache/huggingface | |
| link_dir /mnt/cache /root/.cache | |
| echo "Symlinks ready" | |
| ls -lah /app/ai-toolkit | |
| echo "Starting ai-toolkit..." | |
| exec /start.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment