Created
August 12, 2026 11:19
-
-
Save gpetrousov/0526a3a08775bee99e9688b1808db5da to your computer and use it in GitHub Desktop.
jupyter environment bootstrap script
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
| #!/bin/bash | |
| set -e | |
| PROJECT_NAME=${1:-"jupyter_notebooks"} | |
| echo "Creating project: $PROJECT_NAME..." | |
| mkdir -p "$PROJECT_NAME" | |
| cd "$PROJECT_NAME" | |
| # Init project dependency tracking w/o package boilerplate | |
| uv init -p 3.11.4 --no-package | |
| echo "Configuring PyTorch index for CUDA 12.4..." | |
| cat << 'EOF' >> pyproject.toml | |
| [[tool.uv.index]] | |
| name = "pytorch-cu124" | |
| url = "https://download.pytorch.org/whl/cu124" | |
| explicit = true | |
| [tool.uv.sources] | |
| torch = { index = "pytorch-cu124" } | |
| torchvision = { index = "pytorch-cu124" } | |
| torchaudio = { index = "pytorch-cu124" } | |
| EOF | |
| echo "Adding dependencies and generating lockfile..." | |
| uv add torch torchvision torchaudio ipykernel | |
| echo "Setup complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment