Former-commit-id: 16c2860d56581b90b20ad88631ddc3659ab7b56f
This commit is contained in:
hiyouga 2023-06-07 16:02:07 +08:00
parent 37c6234126
commit fb9dedcb36

View File

@ -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):