From 16c2860d56581b90b20ad88631ddc3659ab7b56f Mon Sep 17 00:00:00 2001 From: hiyouga Date: Wed, 7 Jun 2023 16:02:07 +0800 Subject: [PATCH] tiny fix --- src/api_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api_demo.py b/src/api_demo.py index ac761aaf..81763cda 100644 --- a/src/api_demo.py +++ b/src/api_demo.py @@ -29,7 +29,7 @@ from utils import ( def torch_gc(): - if not torch.cuda.is_available(): + if torch.cuda.is_available(): num_gpus = torch.cuda.device_count() for device_id in range(num_gpus): with torch.cuda.device(device_id):