Skip to content

Commit

Permalink
Allow selection of the onnx runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed May 15, 2023
1 parent b78dc62 commit b9aa494
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,27 @@

-


Pangu-Weather: A 3D High-Resolution Model for Fast and Accurate Global Weather Forecast, arXiv preprint: 2211.02556, 2022.
https://arxiv.org/abs/2211.02556
<https://arxiv.org/abs/2211.02556>

Pangu-Weather was created by Kaifeng Bi, Lingxi Xie, Hengheng Zhang, Xin Chen, Xiaotao Gu and Qi Tian. It is released by Huawei Cloud.

The trained parameters of Pangu-Weather are made available under the terms of the BY-NC-SA 4.0 license.

The commercial use of these models is forbidden.

See https://github.com/198808xc/Pangu-Weather for further details.
See <https://github.com/198808xc/Pangu-Weather> for further details.

### Installation

To install the package, run:

```bash
pip install ai-models-panguweather
```

This will install the package and its dependencies, in particular the ONNX runtime. The installation script will attempt to guess which runtime to install. You can force a given runtime by specifying the the `ONNXRUNTIME` variable, e.g.:

```bash
ONNXRUNTIME=onnxruntime-cpu pip install ai-models-panguweather
```
2 changes: 1 addition & 1 deletion ai_models_panguweather/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.

__version__ = "0.0.2"
__version__ = "0.0.3"
18 changes: 10 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ def has_gpu():
return check_gpus() > 0


onnxruntime = "onnxruntime"
if sys.platform == "darwin":
if platform.machine() == "arm64":
onnxruntime = "onnxruntime-silicon"


if has_gpu():
onnxruntime = "onnxruntime-gpu"
if "ONNXRUNTIME" in os.environ:
onnxruntime = os.environ["ONNXRUNTIME"]
else:
onnxruntime = "onnxruntime"
if sys.platform == "darwin":
if platform.machine() == "arm64":
onnxruntime = "onnxruntime-silicon"

if has_gpu():
onnxruntime = "onnxruntime-gpu"


setuptools.setup(
Expand Down

0 comments on commit b9aa494

Please sign in to comment.