Spaces:
Running
on
Zero
Running
on
Zero
NIRVANALAN
commited on
Commit
Β·
ad1670c
1
Parent(s):
b1f02f8
update dep
Browse files
app.py
CHANGED
|
@@ -411,16 +411,6 @@ if __name__ == "__main__":
|
|
| 411 |
os.environ[
|
| 412 |
"TORCH_DISTRIBUTED_DEBUG"] = "DETAIL" # set to DETAIL for runtime logging.
|
| 413 |
|
| 414 |
-
args = create_argparser().parse_args()
|
| 415 |
-
|
| 416 |
-
# args.local_rank = int(os.environ["LOCAL_RANK"])
|
| 417 |
-
args.local_rank = 0
|
| 418 |
-
args.gpus = th.cuda.device_count()
|
| 419 |
-
|
| 420 |
-
args.rendering_kwargs = rendering_options_defaults(args)
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
# main(args)
|
| 424 |
|
| 425 |
zero = torch.Tensor([0]).cuda()
|
| 426 |
print(zero.device) # <-- 'cpu' π€
|
|
@@ -476,14 +466,20 @@ if __name__ == "__main__":
|
|
| 476 |
|
| 477 |
from utils.infer_utils import remove_background, resize_foreground
|
| 478 |
|
| 479 |
-
SEED = 0
|
| 480 |
|
|
|
|
|
|
|
| 481 |
|
|
|
|
| 482 |
|
|
|
|
|
|
|
|
|
|
| 483 |
|
|
|
|
|
|
|
|
|
|
| 484 |
|
| 485 |
-
print(zero.device) # <-- 'cuda:0' π€
|
| 486 |
-
return f"Hello {zero + n} Tensor"
|
| 487 |
|
| 488 |
demo = gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text())
|
| 489 |
demo.launch()
|
|
|
|
| 411 |
os.environ[
|
| 412 |
"TORCH_DISTRIBUTED_DEBUG"] = "DETAIL" # set to DETAIL for runtime logging.
|
| 413 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 414 |
|
| 415 |
zero = torch.Tensor([0]).cuda()
|
| 416 |
print(zero.device) # <-- 'cpu' π€
|
|
|
|
| 466 |
|
| 467 |
from utils.infer_utils import remove_background, resize_foreground
|
| 468 |
|
|
|
|
| 469 |
|
| 470 |
+
print(zero.device) # <-- 'cuda:0' π€
|
| 471 |
+
return f"Hello {zero + n} Tensor"
|
| 472 |
|
| 473 |
+
# args = create_argparser().parse_args()
|
| 474 |
|
| 475 |
+
# # args.local_rank = int(os.environ["LOCAL_RANK"])
|
| 476 |
+
# args.local_rank = 0
|
| 477 |
+
# args.gpus = th.cuda.device_count()
|
| 478 |
|
| 479 |
+
# args.rendering_kwargs = rendering_options_defaults(args)
|
| 480 |
+
|
| 481 |
+
# main(args)
|
| 482 |
|
|
|
|
|
|
|
| 483 |
|
| 484 |
demo = gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text())
|
| 485 |
demo.launch()
|