wheattoast11 commited on
Commit
86ec003
·
verified ·
1 Parent(s): d5238a3

Fix Python version mismatch - use python3 -m pip and python3 in CMD

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -4
Dockerfile CHANGED
@@ -7,10 +7,11 @@ RUN apt-get update && apt-get install -y \
7
 
8
  # Set Python 3.11 as default
9
  RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
 
10
  RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
11
 
12
- # Install PyTorch and ML libraries
13
- RUN pip install --no-cache-dir \
14
  torch==2.3.0 \
15
  transformers>=4.45.0 \
16
  datasets>=2.18.0 \
@@ -36,5 +37,5 @@ ENV HF_HUB_ENABLE_HF_TRANSFER=1
36
  # Expose Gradio port
37
  EXPOSE 7860
38
 
39
- # Run training app
40
- CMD ["python", "app.py"]
 
7
 
8
  # Set Python 3.11 as default
9
  RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
10
+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
11
  RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
12
 
13
+ # Install PyTorch and ML libraries using python3 -m pip to ensure correct Python
14
+ RUN python3 -m pip install --no-cache-dir \
15
  torch==2.3.0 \
16
  transformers>=4.45.0 \
17
  datasets>=2.18.0 \
 
37
  # Expose Gradio port
38
  EXPOSE 7860
39
 
40
+ # Run training app with python3 explicitly
41
+ CMD ["python3", "app.py"]