Spaces:
Build error
Build error
Further refine PyTorch verification command in Dockerfile for robust syntax parsing
Browse files- 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:
|
61 |
-
RUN conda run -n cosmos-predict1 python -c "
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
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.
|