Spaces:
Running
Running
yjwtheonly
commited on
Commit
·
5b98825
1
Parent(s):
144e87a
sever
Browse files
server.py
CHANGED
@@ -38,13 +38,13 @@ parser.add_argument('--init-mode', type = str, default='single', help = 'How to
|
|
38 |
args = parser.parse_args()
|
39 |
args = utils.set_hyperparams(args)
|
40 |
|
41 |
-
|
42 |
-
device = torch.device("cpu")
|
43 |
args.device = device
|
44 |
args.device1 = device
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
|
49 |
utils.seed_all(args.seed)
|
50 |
np.set_printoptions(precision=5)
|
|
|
38 |
args = parser.parse_args()
|
39 |
args = utils.set_hyperparams(args)
|
40 |
|
41 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
42 |
+
# device = torch.device("cpu")
|
43 |
args.device = device
|
44 |
args.device1 = device
|
45 |
+
if torch.cuda.device_count() >= 2:
|
46 |
+
args.device = "cuda:0"
|
47 |
+
args.device1 = "cuda:1"
|
48 |
|
49 |
utils.seed_all(args.seed)
|
50 |
np.set_printoptions(precision=5)
|