Skip to content

Commit 2cac064

Browse files
committed
Install CPU torch by default
1 parent e62248a commit 2cac064

File tree

3 files changed

+151
-174
lines changed

3 files changed

+151
-174
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,34 @@ To install the dependencies, run the following command:
1818
uv sync
1919
```
2020

21+
### PyTorch version
22+
23+
PyTorch is default set to CPU distributive:
24+
25+
```toml
26+
[tool.uv.sources]
27+
torch = {index = "pytorch-cpu"}
28+
```
29+
30+
If you want to use a CUDA distributive, replace index with one of the following values:
31+
32+
- `pytorch-cu118`
33+
- `pytorch-cu124`
34+
- `pytorch-cu126`
35+
36+
Regenerate lock file:
37+
```shell
38+
uv lock
39+
```
40+
41+
> Please do not commit updated lock file into GIT
42+
43+
Install dependencies from the updated lock file:
44+
45+
```shell
46+
uv sync
47+
```
48+
2149
## How it works
2250

2351
We use [`nomic-ai/nomic-embed-text-v1`](https://huggingface.co/nomic-ai/nomic-embed-text-v1) to create embeddings from text.

pyproject.toml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,25 @@ dependencies = [
1515
"torch",
1616
]
1717

18+
[tool.uv.sources]
19+
torch = {index = "pytorch-cpu"}
20+
1821
[[tool.uv.index]]
1922
name = "pytorch-cu118"
2023
url = "https://download.pytorch.org/whl/cu118"
2124
explicit = true
2225

23-
[tool.uv.sources]
24-
torch = {index = "pytorch-cu118"}
26+
[[tool.uv.index]]
27+
name = "pytorch-cu124"
28+
url = "https://download.pytorch.org/whl/cu124"
29+
explicit = true
30+
31+
[[tool.uv.index]]
32+
name = "pytorch-cu126"
33+
url = "https://download.pytorch.org/whl/cu126"
34+
explicit = true
35+
36+
[[tool.uv.index]]
37+
name = "pytorch-cpu"
38+
url = "https://download.pytorch.org/whl/cpu"
39+
explicit = true

0 commit comments

Comments
 (0)