Download test_gpu.py from kevinlu4588/ErasingDiffusionModels: direct link, hf CLI and curl.
- Browser
- Download file 299 Bytes
-
https://huggingface.co/kevinlu4588/ErasingDiffusionModels/resolve/main/test_gpu.py
- Command line
-
hf download hf://kevinlu4588/ErasingDiffusionModels/test_gpu.py
-
curl -L -o test_gpu.py https://huggingface.co/kevinlu4588/ErasingDiffusionModels/resolve/main/test_gpu.py
299 Bytes
| import torch | |
| # Check if PyTorch is installed and environment is working | |
| print("Conda environment is working!") | |
| # Check for GPU availability | |
| if torch.cuda.is_available(): | |
| print("GPU is available!") | |
| print(f"GPU Name: {torch.cuda.get_device_name(0)}") | |
| else: | |
| print("GPU is not available.") |