parokshsaxena commited on
Commit
b436f14
1 Parent(s): 639c3ec

updating dockerfile based on chatGPT for error module torch not found

Browse files
Files changed (2) hide show
  1. Dockerfile +9 -1
  2. environment.yaml +1 -0
Dockerfile CHANGED
@@ -6,6 +6,9 @@ COPY ./environment.yml /code/environment.yml
6
  # Create the environment using the environment.yml file
7
  RUN conda env create -f /code/environment.yml
8
 
 
 
 
9
  # Set up a new user named "user" with user ID 1000
10
  RUN useradd -m -u 1000 user
11
  # Switch to the "user" user
@@ -26,4 +29,9 @@ WORKDIR $HOME/app
26
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
27
  COPY --chown=user . $HOME/app
28
 
29
- CMD ["./run.sh"]
 
 
 
 
 
 
6
  # Create the environment using the environment.yml file
7
  RUN conda env create -f /code/environment.yml
8
 
9
+ # Make RUN commands use the new environment: From ChatGPT
10
+ SHELL ["conda", "run", "-n", "idm", "/bin/bash", "-c"]
11
+
12
  # Set up a new user named "user" with user ID 1000
13
  RUN useradd -m -u 1000 user
14
  # Switch to the "user" user
 
29
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
30
  COPY --chown=user . $HOME/app
31
 
32
+ # From ChatGPT
33
+ # CMD ["./run.sh"]
34
+ # Make sure conda is initialized for the user
35
+ RUN echo "conda activate idm" >> ~/.bashrc
36
+
37
+ CMD ["conda", "run", "--no-capture-output", "-n", "idm", "./run.sh"]
environment.yaml CHANGED
@@ -15,6 +15,7 @@ dependencies:
15
 
16
  - pip:
17
  - accelerate==0.25.0
 
18
  - torchmetrics==1.2.1
19
  - tqdm==4.66.1
20
  - transformers==4.36.2
 
15
 
16
  - pip:
17
  - accelerate==0.25.0
18
+ - torch==2.0.1
19
  - torchmetrics==1.2.1
20
  - tqdm==4.66.1
21
  - transformers==4.36.2