Skip to content

Commit 689d2b3

Browse files
committed
RHOAIENG-39330: fix e2e per PR tests
1 parent d202cd4 commit 689d2b3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/e2e/mnist.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
print("ACCELERATOR: is ", os.getenv("ACCELERATOR"))
4343
ACCELERATOR = os.getenv("ACCELERATOR")
4444

45+
# If GPU is requested but CUDA is not available, fall back to CPU
46+
if ACCELERATOR == "gpu" and not torch.cuda.is_available():
47+
print("Warning: GPU requested but CUDA is not available. Falling back to CPU.")
48+
ACCELERATOR = "cpu"
49+
4550
STORAGE_BUCKET_EXISTS = "AWS_DEFAULT_ENDPOINT" in os.environ
4651
print("STORAGE_BUCKET_EXISTS: ", STORAGE_BUCKET_EXISTS)
4752

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
--extra-index-url https://download.pytorch.org/whl/cu118
2+
torch==2.5.1
3+
torchvision==0.20.1
14
pytorch_lightning==1.9.5
25
torchmetrics==0.9.1
3-
torchvision==0.20.1
46
minio

0 commit comments

Comments
 (0)