elungky commited on
Commit
b7ff06a
·
1 Parent(s): 701e903

Further refine PyTorch verification command in Dockerfile for robust syntax parsing

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -8
Dockerfile CHANGED
@@ -57,14 +57,16 @@ RUN echo "Verifying Python and Conda installations..."
57
  RUN python --version
58
  RUN conda env list
59
  RUN echo "Verifying PyTorch and CUDA availability..."
60
- # REVISED: Use simpler string concatenation and conditional logic in Python
61
- RUN conda run -n cosmos-predict1 python -c "import torch; \
62
- print('PyTorch Version: ' + torch.__version__); \
63
- print('CUDA Available: ' + str(torch.cuda.is_available())); \
64
- if torch.cuda.is_available(): \
65
- print('CUDA Device Name: ' + torch.cuda.get_device_name(0)); \
66
- else: \
67
- print('CUDA Device Name: N/A')" || echo "PyTorch verification failed. Check dependencies in cosmos-predict1.yaml."
 
 
68
  # --- End Verification Steps ---
69
 
70
  # Make the start.sh script executable.
 
57
  RUN python --version
58
  RUN conda env list
59
  RUN echo "Verifying PyTorch and CUDA availability..."
60
+ # REVISED: Break into more explicit separate statements with newlines for robustness
61
+ RUN conda run -n cosmos-predict1 python -c "\
62
+ import torch;\n\
63
+ print('PyTorch Version: ' + torch.__version__);\n\
64
+ print('CUDA Available: ' + str(torch.cuda.is_available()));\n\
65
+ if torch.cuda.is_available():\n\
66
+ print('CUDA Device Name: ' + torch.cuda.get_device_name(0));\n\
67
+ else:\n\
68
+ print('CUDA Device Name: N/A');\n\
69
+ " || echo "PyTorch verification failed. Check dependencies in cosmos-predict1.yaml."
70
  # --- End Verification Steps ---
71
 
72
  # Make the start.sh script executable.