Skip to content

Commit

Permalink
make downloaded models readable by all users (#31)
Browse files Browse the repository at this point in the history
Downloaded models are made with mode 0600. This is because they start
out as tempfile.NamedTemporaryFile objects, which are by default made
with 0600 mode.
  • Loading branch information
kaczmarj authored Oct 29, 2022
1 parent 295bbb7 commit 317b00d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dockerfiles/tils.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-TILs-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
# Downloaded models are mode 0600. Make them readable by all users.
RUN chmod -R +r $TORCH_HOME/hub/checkpoints/
2 changes: 2 additions & 0 deletions dockerfiles/tumor-brca.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-BRCA-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
# Downloaded models are mode 0600. Make them readable by all users.
RUN chmod -R +r $TORCH_HOME/hub/checkpoints/
2 changes: 2 additions & 0 deletions dockerfiles/tumor-luad.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-LUAD-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
# Downloaded models are mode 0600. Make them readable by all users.
RUN chmod -R +r $TORCH_HOME/hub/checkpoints/
2 changes: 2 additions & 0 deletions dockerfiles/tumor-paad.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-PAAD-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
# Downloaded models are mode 0600. Make them readable by all users.
RUN chmod -R +r $TORCH_HOME/hub/checkpoints/
2 changes: 2 additions & 0 deletions dockerfiles/tumor-prad.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ ENV WSIRUN_WEIGHTS="TCGA-PRAD-v1"

# Download the weights.
RUN python -c "from wsi_inference.modellib import models; models.$WSIRUN_MODEL(\"$WSIRUN_WEIGHTS\")"
# Downloaded models are mode 0600. Make them readable by all users.
RUN chmod -R +r $TORCH_HOME/hub/checkpoints/

0 comments on commit 317b00d

Please sign in to comment.