Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
matbun committed Jan 9, 2025
1 parent 270474d commit c275a8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/itwinai/torch/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ def local_world_size(self) -> int:
return torch.cuda.device_count()
if "LOCAL_WORLD_SIZE" not in os.environ:
raise RuntimeError(
"Could not retrieve local world size as CUDA is unavailable and there is "
"no 'LOCAL_WORLD_SIZE' environment variable."
)
"Could not retrieve local world size as CUDA is unavailable and there is "
"no 'LOCAL_WORLD_SIZE' environment variable."
)
return int(os.environ["LOCAL_WORLD_SIZE"])

@check_initialized
Expand Down Expand Up @@ -676,9 +676,9 @@ def local_world_size(self) -> int:
return torch.cuda.device_count()
if "LOCAL_WORLD_SIZE" not in os.environ:
raise RuntimeError(
"Could not retrieve local world size as CUDA is unavailable and there is "
"no 'LOCAL_WORLD_SIZE' environment variable."
)
"Could not retrieve local world size as CUDA is unavailable and there is "
"no 'LOCAL_WORLD_SIZE' environment variable."
)
return int(os.environ["LOCAL_WORLD_SIZE"])

@check_initialized
Expand Down
3 changes: 2 additions & 1 deletion tutorials/distributed-ml/torch-kubeflow-1/train-cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ def main():
open("DATASET_READY", "w")
else:
import time

while not os.path.exists("DATASET_READY"):
# Wait for the dataset to be downloaded
time.sleep(1)

# Dataset creation
train_dataset = datasets.MNIST("data", train=True, download=False, transform=transform)
validation_dataset = datasets.MNIST(
Expand Down

0 comments on commit c275a8c

Please sign in to comment.