From 4bb6ea416ef8c91a414cfc6bd6bd3e0f69bb4062 Mon Sep 17 00:00:00 2001 From: Somdev Sangwan Date: Mon, 29 May 2023 23:10:52 +0530 Subject: [PATCH] reverse providers logic --- core/globals.py | 4 +++- run.py | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/globals.py b/core/globals.py index 1206d54..83d7277 100644 --- a/core/globals.py +++ b/core/globals.py @@ -1,2 +1,4 @@ +import onnxruntime + use_gpu = False -providers = ['CPUExecutionProvider'] +providers = onnxruntime.get_available_providers() diff --git a/run.py b/run.py index 2ddde36..35e9913 100644 --- a/run.py +++ b/run.py @@ -1,9 +1,8 @@ import sys -import onnxruntime import core.globals -if '--gpu' in sys.argv: - core.globals.providers = onnxruntime.get_available_providers() +if '--gpu' not in sys.argv: + core.globals.providers = ['CPUExecutionProvider'] import glob import argparse