Skip to content

Commit

Permalink
🚑 fix: restore 'cpu' 'extra' dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousDolphin committed Feb 5, 2025
1 parent faf971f commit 1e51ae6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/cpu/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"remoteUser": "root",
"workspaceFolder": "${localWorkspaceFolder}",
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"postCreateCommand": "uv pip install -e .[dev]",
"postCreateCommand": "uv pip install -e .[cpu,dev]",
"remoteEnv": {
"UV_SYSTEM_PYTHON": "true"
},
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt-get update && \
WORKDIR /app
COPY focoos ./focoos
COPY pyproject.toml ./pyproject.toml
RUN uv pip install --system -e .
RUN uv pip install --system -e .[cpu]


FROM ghcr.io/focoosai/deeplearning:base-cu12-cudnn9-py312-uv AS focoos-cuda
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ venv:
@uv venv --python=python3.12

install: .uv .pre-commit
@uv pip install -e ".[dev]" --no-cache-dir
@uv pip install -e ".[cuda,dev]" --no-cache-dir
@pre-commit install

install-gpu: .uv .pre-commit
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Foocoos is shipped with the following extras dependencies:
## CPU only or Remote Usage

```bash
uv pip install focoos git+https://github.com/FocoosAI/focoos.git
uv pip install focoos[cpu] git+https://github.com/FocoosAI/focoos.git
```

## GPU Runtimes
Expand All @@ -60,11 +60,7 @@ uv pip install focoos[torch] git+https://github.com/FocoosAI/focoos.git
```

### OnnxRuntime CUDA
ensure that you have CUDA 12 and cuDNN 9 installed, as they are required for onnxruntime version 1.20.1.

```bash
apt-get -y install cudnn9-cuda-12
```
-

```bash
uv pip install focoos[cuda] git+https://github.com/FocoosAI/focoos.gi
Expand Down
5 changes: 3 additions & 2 deletions docs/getting_started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Focoos models support multiple inference runtimes.
To keep the library lightweight and to allow users to use their environment, optional dependencies (e.g., torch, onnxruntime, tensorrt) are not installed by default.
Foocoos is shipped with the following extras dependencies:

- `[torch]`: torchscript CUDA
- `[cpu]`: onnxruntime CPU
- `[cuda]`: onnxruntime CUDA
- `[torch]`: torchscript CUDA
- `[tensorrt]`: onnxruntime TensorRT

!!! note
Expand Down Expand Up @@ -40,7 +41,7 @@ source .venv/bin/activate
If you plan to run the SDK on a CPU-only environment:

```bash linenums="0"
pip install 'focoos @ git+https://github.com/FocoosAI/focoos.git'
pip install 'focoos[cpu] @ git+https://github.com/FocoosAI/focoos.git'
```

* NVIDIA GPU Environment (torchscript)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ dependencies = [
"setuptools~=75.7.0",
"matplotlib~=3.10.0",
"colorama~=0.4.6",
"ipython",
"onnxruntime==1.20.1"
"ipython"
]

authors = [{ name = "focoos.ai", email = "[email protected]" }]
Expand All @@ -58,6 +57,7 @@ keywords = [
]

[project.optional-dependencies]
cpu = ["onnxruntime==1.20.1"]
cuda = ["onnxruntime-gpu==1.20.1"]
tensorrt = ["onnxruntime-gpu==1.20.1","tensorrt==10.5.0"]
torch = ["torch==2.3.0","torchvision"]
Expand Down

0 comments on commit 1e51ae6

Please sign in to comment.