1
0
Fork 0

feat(api): add requirements file for each platform (#193)

This commit is contained in:
Sean Sube 2023-03-05 17:55:23 -06:00
parent f575cba7d3
commit 31054c4ee3
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
10 changed files with 69 additions and 5 deletions

View File

@ -167,7 +167,7 @@ package-api-twine:
cache:
key:
files:
- api/dev-requirements.txt
- api/requirements/dev.txt
paths:
- .cache/pip
policy: pull-push

View File

@ -172,13 +172,26 @@ Update pip itself:
### Install pip packages
You can install of the necessary packages at once using [the `requirements.txt` file](./api/requirements.txt):
You can install all of the necessary packages at once using [the `requirements/base.txt` file](./api/requirements/base.txt)
and the `requirements/` file for your platform:
```shell
> pip install -r requirements.txt
> pip install -r requirements/base.txt -r requirements/amd-linux.txt
# or
> pip install -r requirements/base.txt -r requirements/amd-windows.txt
# or
> pip install -r requirements/base.txt -r requirements/amd-windows-nightly.txt
# or
> pip install -r requirements/base.txt -r requirements/cpu.txt
# or
> pip install -r requirements/base.txt -r requirements/nvidia.txt
```
_Or_ you can install them manually using pip:
Only install one of the platform-specific requirements files, otherwise you may end up with the wrong version of
PyTorch or the ONNX runtime. The ONNX runtime nightly packages used by `amd-windows-nightly.txt` can be substantially
faster than the latest release, but may not always be stable.
If you prefer, you can install all of the packages manually using pip:
```shell
> pip install "numpy>=1.20,<1.24"

View File

@ -13,7 +13,7 @@ pip: check-venv
pip install -r requirements.txt
pip-dev: check-venv
pip install -r dev-requirements.txt
pip install -r requirements/dev.txt
test:
python -m coverage run -m unittest discover -s tests/

View File

@ -0,0 +1,5 @@
--index-url https://download.pytorch.org/whl/rocm5.2
torch
--index-url https://download.pytorch.org/whl/rocm5.2
torchvision
onnxruntime

View File

@ -0,0 +1,6 @@
--index-url https://download.pytorch.org/whl/cpu
torch
--index-url https://download.pytorch.org/whl/cpu
torchvision
--index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/
ort-nightly-directml

View File

@ -0,0 +1,5 @@
--index-url https://download.pytorch.org/whl/cpu
torch
--index-url https://download.pytorch.org/whl/cpu
torchvision
onnxruntime-directml

26
api/requirements/base.txt Normal file
View File

@ -0,0 +1,26 @@
### Specific versions ###
numpy>=1.20,<1.24
protobuf<4,>=3.20.2
### AI packages ###
accelerate
diffusers
onnx
# onnxruntime has many platform-specific packages
safetensors
transformers
#### Upscaling and face correction
basicsr
codeformer-perceptor
facexlib
gfpgan
realesrgan
### Server packages ###
boto3
flask
flask-cors
jsonschema
pyyaml
setproctitle

4
api/requirements/cpu.txt Normal file
View File

@ -0,0 +1,4 @@
--index-url https://download.pytorch.org/whl/cpu
torch
--index-url https://download.pytorch.org/whl/cpu
torchvision

View File

@ -0,0 +1,5 @@
--index-url https://download.pytorch.org/whl/cu117
torch
--index-url https://download.pytorch.org/whl/cu117
torchvision
onnxruntime-gpu