Skip to content

Commit 566a8bd

Browse files
authored
Merge pull request #12 from acceleratescience/11-migrate-to-uv
Migrate to uv
2 parents ec01f3a + 4fa93b4 commit 566a8bd

File tree

6 files changed

+2621
-8
lines changed

6 files changed

+2621
-8
lines changed

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
/venv
1+
venv/
22
docs/.DS_Store
33
/notebooks/data/
44

55
/data
66
/ignore
77

88
.DS_Store
9-
__pycache__
9+
__pycache__
10+
11+
# PyCharm project files
12+
# These files are machine specific and not useful to developers on VS Code or other editors
13+
.idea/
14+
15+
# Python package build artifacts
16+
*.egg-info/
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Running Locally
2+
3+
You can run the notebooks locally on your own machine by following the steps below.
4+
5+
We recommend using `uv` for dependencies as it is much faster and automatically manages a `.venv` for you.
6+
7+
However, you can also install dependencies with plain `pip` if you prefer.
8+
9+
>
10+
> PyTorch (`torch`) is **not included** in the installation instructions below. PyTorch wheels differ depending on your system and can be very large if installed incorrectly.
11+
>
12+
> Please install the version suitable for your setup by following the [official PyTorch installation guide](https://pytorch.org/get-started/locally/).
13+
14+
## 1. Cloning the repository
15+
Clone the repository to your machine:
16+
```bash
17+
git clone https://github.com/acceleratescience/diffusion-models
18+
cd diffusion-models
19+
```
20+
Alternatively, if you're using an IDE such as VS Code or PyCharm, you can paste the repository URL directly into the IDE's respective clone repository UI.
21+
22+
## 2. Installing dependencies with `uv` (preferred)
23+
### Windows (Powershell)
24+
Install uv if needed:
25+
```bash
26+
irm https://astral.sh/uv/install.ps1 | iex
27+
```
28+
Create the virtual environment and install dependencies:
29+
```bash
30+
uv sync
31+
```
32+
Finally, activate the environment:
33+
```bash
34+
.\.venv\Scripts\activate
35+
```
36+
### macOS / Linux
37+
Install uv if needed:
38+
```bash
39+
curl -LsSf https://astral.sh/uv/install.sh | sh
40+
```
41+
Create the virtual environment and install dependencies:
42+
```bash
43+
uv sync
44+
```
45+
Finally, activate the environment:
46+
```bash
47+
source .venv/bin/activate
48+
```
49+
50+
## 3. Installing dependencies with `pip` (alternative)
51+
### Windows (Powershell)
52+
Create and activate an empty virtual environment:
53+
```bash
54+
python3 -m diffusion-models .venv
55+
.\.venv\Scripts\activate
56+
```
57+
Finally, install dependencies to virtual environment:
58+
```bash
59+
pip install .
60+
```
61+
### macOS / Linux
62+
Create and activate an empty virtual environment:
63+
```bash
64+
python3 -m diffusion-models .venv
65+
source .venv\bin\activate
66+
```
67+
Finally, install dependencies to virtual environment:
68+
```bash
69+
pip install .
70+
```

mkdocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ nav:
77
- The Workshop: Home/workshop.md
88
- License: Home/LICENSE.md
99
- About us: Home/about.md
10-
- Introduction: Introduction/Introduction.md
10+
- Introduction:
11+
- Introduction: Introduction/Introduction.md
12+
- Running Locally: Introduction/running-locally.md
1113
- Physics: Physics/Physics.md
1214
- Building Blocks:
1315
- BuildingBlocks/index.md

pyproject.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[project]
2+
name = "diffusion-models"
3+
version = "0.1.0"
4+
description = "A guide to working with diffusion models"
5+
authors = [
6+
{ name = "Ryan Daniels"},
7+
{ name = "Fin Griffin"},
8+
]
9+
license = { text = "GPL-3.0-or-later" }
10+
readme = "README.md"
11+
requires-python = ">=3.11,<4.0"
12+
dependencies = [
13+
"matplotlib==3.9.0",
14+
"seaborn==0.13.2",
15+
"diffusers==0.28.2",
16+
"transformers==4.41.2",
17+
"scikit-learn>=1.5.2",
18+
"ipykernel>=6.30.1",
19+
]
20+
21+
[dependency-groups]
22+
dev = [
23+
"mkdocs>=1.6.1,<2.0.0",
24+
"mkdocs-pdf>=0.1.2",
25+
"mkdocs-jupyter>=0.25.1",
26+
"mkdocs-material>=9.5.44,<10.0.0",
27+
"mkdocstrings>=0.27.0,<0.28.0",
28+
"pre-commit>=4.3.0",
29+
]
30+
31+
[tool.setuptools]
32+
packages = ["diffusion_models"]
33+
34+
[build-system]
35+
requires = ["setuptools>=61.0"]
36+
build-backend = "setuptools.build_meta"

requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)