Spaces:
Running
Running
Update dockerfile, path to cudnn
Browse files- Dockerfile +3 -3
Dockerfile
CHANGED
@@ -73,11 +73,11 @@ RUN if [ -f "/app/FILM.py" ]; then \
|
|
73 |
# Add try-except around model call\
|
74 |
sed -i '/def __call__/a\ try:' /app/FILM.py && \
|
75 |
sed -i '/result = self._model/i\ # Try with GPU' /app/FILM.py && \
|
76 |
-
sed -i '/result = self._model/a\ except Exception as e:\n print(f"GPU inference failed: {e}, falling back to CPU")\n
|
77 |
fi
|
78 |
|
79 |
# Set environment variables for GPU compatibility
|
80 |
-
ENV LD_LIBRARY_PATH=/usr/
|
81 |
ENV PATH=/usr/local/cuda/bin:${PATH}
|
82 |
ENV TF_FORCE_GPU_ALLOW_GROWTH=true
|
83 |
|
@@ -89,7 +89,7 @@ EXPOSE 8501
|
|
89 |
# Create a startup script that ensures proper execution
|
90 |
RUN echo '#!/bin/bash\n\
|
91 |
# Ensure library paths are set correctly\n\
|
92 |
-
export LD_LIBRARY_PATH=/usr/
|
93 |
# Run the app\n\
|
94 |
exec streamlit run app.py --server.port=8501 --server.address=0.0.0.0\n\
|
95 |
' > /app/start.sh && chmod +x /app/start.sh
|
|
|
73 |
# Add try-except around model call\
|
74 |
sed -i '/def __call__/a\ try:' /app/FILM.py && \
|
75 |
sed -i '/result = self._model/i\ # Try with GPU' /app/FILM.py && \
|
76 |
+
sed -i '/result = self._model/a\ except Exception as e:\n print(f"GPU inference failed: {e}, falling back to CPU")\n with tf.device("/cpu:0"):\n result = self._model(inputs, training=False)' /app/FILM.py; \
|
77 |
fi
|
78 |
|
79 |
# Set environment variables for GPU compatibility
|
80 |
+
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/cuda/lib64
|
81 |
ENV PATH=/usr/local/cuda/bin:${PATH}
|
82 |
ENV TF_FORCE_GPU_ALLOW_GROWTH=true
|
83 |
|
|
|
89 |
# Create a startup script that ensures proper execution
|
90 |
RUN echo '#!/bin/bash\n\
|
91 |
# Ensure library paths are set correctly\n\
|
92 |
+
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/cuda/lib64\n\
|
93 |
# Run the app\n\
|
94 |
exec streamlit run app.py --server.port=8501 --server.address=0.0.0.0\n\
|
95 |
' > /app/start.sh && chmod +x /app/start.sh
|