From 1392a45170991336462279e1bf4191ebb2b48408 Mon Sep 17 00:00:00 2001 From: FNsi <125447286+FNsi@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:47:48 +0800 Subject: [PATCH 1/7] Update __init__.py --- backend/src/packages/chaiNNer_onnx/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/packages/chaiNNer_onnx/__init__.py b/backend/src/packages/chaiNNer_onnx/__init__.py index e99d17407..b5a69bf06 100644 --- a/backend/src/packages/chaiNNer_onnx/__init__.py +++ b/backend/src/packages/chaiNNer_onnx/__init__.py @@ -31,9 +31,9 @@ def get_onnx_runtime(): else: return Dependency( display_name="ONNX Runtime", - pypi_name="onnxruntime", + pypi_name="onnxruntime-directml", version="1.17.1", - size_estimate=6 * MB, + size_estimate=30 * MB, ) @@ -49,6 +49,7 @@ def get_onnx_runtime(): version="1.16.0", size_estimate=12 * MB, ), + Dependency( display_name="ONNX Optimizer", pypi_name="onnxoptimizer", From d7250cec2b36de2b6e84a3664c56668657890d41 Mon Sep 17 00:00:00 2001 From: FNsi <125447286+FNsi@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:10:52 +0800 Subject: [PATCH 2/7] Update __init__.py --- .../src/packages/chaiNNer_onnx/__init__.py | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/src/packages/chaiNNer_onnx/__init__.py b/backend/src/packages/chaiNNer_onnx/__init__.py index b5a69bf06..3bc9d3bff 100644 --- a/backend/src/packages/chaiNNer_onnx/__init__.py +++ b/backend/src/packages/chaiNNer_onnx/__init__.py @@ -2,7 +2,7 @@ from api import KB, MB, Dependency, add_package from gpu import nvidia -from system import is_arm_mac +from system import is_arm_mac, is_windows general = "ONNX uses .onnx models to upscale images." conversion = "It also helps to convert between PyTorch and NCNN." @@ -29,13 +29,20 @@ def get_onnx_runtime(): extra_index_url="https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/", ) else: - return Dependency( - display_name="ONNX Runtime", - pypi_name="onnxruntime-directml", - version="1.17.1", - size_estimate=30 * MB, + if is_windows: + return Dependency( + display_name="ONNX Runtime (DirectMl)", + pypi_name="onnxruntime-directml", + version="1.17.1", + size_estimate=30 * MB, ) - + else: + return Dependency( + display_name="ONNX Runtime", + pypi_name="onnxruntiml", + version="1.17.1", + size_estimate=6 * MB, + } package = add_package( __file__, From c1bb3a23bbde12cca56783b63b53a8c0fa567301 Mon Sep 17 00:00:00 2001 From: FNsi <125447286+FNsi@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:19:40 +0800 Subject: [PATCH 3/7] Update __init__.py --- backend/src/packages/chaiNNer_onnx/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/packages/chaiNNer_onnx/__init__.py b/backend/src/packages/chaiNNer_onnx/__init__.py index 3bc9d3bff..8b52a8113 100644 --- a/backend/src/packages/chaiNNer_onnx/__init__.py +++ b/backend/src/packages/chaiNNer_onnx/__init__.py @@ -15,7 +15,7 @@ f"{general} {conversion} It is fastest when CUDA is supported. If TensorRT is" " installed on the system, it can also be configured to use that." ) - inst_hint = f"{general} It does not support AMD GPUs." + inst_hint = f"{general} It does not support AMD GPUs, in linux." def get_onnx_runtime(): @@ -39,7 +39,7 @@ def get_onnx_runtime(): else: return Dependency( display_name="ONNX Runtime", - pypi_name="onnxruntiml", + pypi_name="onnxruntime", version="1.17.1", size_estimate=6 * MB, } From 26d7fbeb1556fd1b7991a822f366388de13160c3 Mon Sep 17 00:00:00 2001 From: FNsi <125447286+FNsi@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:22:08 +0800 Subject: [PATCH 4/7] Update __init__.py --- backend/src/packages/chaiNNer_onnx/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/packages/chaiNNer_onnx/__init__.py b/backend/src/packages/chaiNNer_onnx/__init__.py index 8b52a8113..4da37fed6 100644 --- a/backend/src/packages/chaiNNer_onnx/__init__.py +++ b/backend/src/packages/chaiNNer_onnx/__init__.py @@ -42,7 +42,7 @@ def get_onnx_runtime(): pypi_name="onnxruntime", version="1.17.1", size_estimate=6 * MB, - } + ) package = add_package( __file__, From 86b401f56a733c5a899fe5ee7bf335b92b088101 Mon Sep 17 00:00:00 2001 From: FNsi <125447286+FNsi@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:19:04 +0800 Subject: [PATCH 5/7] Update __init__.py --- .../src/packages/chaiNNer_onnx/__init__.py | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/backend/src/packages/chaiNNer_onnx/__init__.py b/backend/src/packages/chaiNNer_onnx/__init__.py index 4da37fed6..4de3c37e9 100644 --- a/backend/src/packages/chaiNNer_onnx/__init__.py +++ b/backend/src/packages/chaiNNer_onnx/__init__.py @@ -28,21 +28,21 @@ def get_onnx_runtime(): import_name="onnxruntime", extra_index_url="https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/", ) + elif is_windows: + return Dependency( + display_name="ONNX Runtime (DirectMl)", + pypi_name="onnxruntime-directml", + version="1.17.1", + size_estimate=30 * MB, + ) else: - if is_windows: - return Dependency( - display_name="ONNX Runtime (DirectMl)", - pypi_name="onnxruntime-directml", - version="1.17.1", - size_estimate=30 * MB, + return Dependency( + display_name="ONNX Runtime", + pypi_name="onnxruntime", + version="1.17.1", + size_estimate=6 * MB, ) - else: - return Dependency( - display_name="ONNX Runtime", - pypi_name="onnxruntime", - version="1.17.1", - size_estimate=6 * MB, - ) + package = add_package( __file__, @@ -56,7 +56,6 @@ def get_onnx_runtime(): version="1.16.0", size_estimate=12 * MB, ), - Dependency( display_name="ONNX Optimizer", pypi_name="onnxoptimizer", @@ -83,6 +82,3 @@ def get_onnx_runtime(): color="#63B3ED", install_hint=inst_hint, ) - - -logger.debug(f"Loaded package {package.name}") From 5fd703bab405181235f66dbb364f8df3d3e547af Mon Sep 17 00:00:00 2001 From: FNsi <125447286+FNsi@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:22:33 +0800 Subject: [PATCH 6/7] Update __init__.py --- backend/src/packages/chaiNNer_onnx/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/packages/chaiNNer_onnx/__init__.py b/backend/src/packages/chaiNNer_onnx/__init__.py index 4de3c37e9..61082a782 100644 --- a/backend/src/packages/chaiNNer_onnx/__init__.py +++ b/backend/src/packages/chaiNNer_onnx/__init__.py @@ -82,3 +82,6 @@ def get_onnx_runtime(): color="#63B3ED", install_hint=inst_hint, ) + + +logger.debug(f"Loaded package {package.name}") From 9748e1f9b2930e4f98f05ee6cb1bdd5f2bf67d86 Mon Sep 17 00:00:00 2001 From: FNsi <125447286+FNsi@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:26:55 +0800 Subject: [PATCH 7/7] Update __init__.py --- backend/src/packages/chaiNNer_onnx/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/packages/chaiNNer_onnx/__init__.py b/backend/src/packages/chaiNNer_onnx/__init__.py index 61082a782..a57ca7b83 100644 --- a/backend/src/packages/chaiNNer_onnx/__init__.py +++ b/backend/src/packages/chaiNNer_onnx/__init__.py @@ -33,7 +33,7 @@ def get_onnx_runtime(): display_name="ONNX Runtime (DirectMl)", pypi_name="onnxruntime-directml", version="1.17.1", - size_estimate=30 * MB, + size_estimate=15 * MB, ) else: return Dependency(