ejschwartz commited on
Commit
0e44cbc
·
verified ·
1 Parent(s): 7cbd81a

Disable python buffering

Browse files

By default, python buffers standard output. This interacts poorly with the Huggingface logs viewer, and often results in standard output not being logged. This commit fixes this problem.

Files changed (1) hide show
  1. Dockerfile +3 -0
Dockerfile CHANGED
@@ -25,4 +25,7 @@ WORKDIR $HOME/app
25
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
26
  COPY --chown=user . $HOME/app
27
 
 
 
 
28
  CMD ["python", "main.py"]
 
25
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
26
  COPY --chown=user . $HOME/app
27
 
28
+ # Disable buffering to allow logging of standard output.
29
+ ENV PYTHONUNBUFFERED=1
30
+
31
  CMD ["python", "main.py"]