listen2you commited on
Commit
34614a7
·
1 Parent(s): 08f4fb8

fix the bug of environment variables

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -3
  2. get_flash_attn.py +1 -1
Dockerfile CHANGED
@@ -34,9 +34,8 @@ ENV HOME=/home/user \
34
 
35
  RUN pip3 install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
36
  RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
37
- RUN python /code/get_flash_attn.py > /code/url.txt
38
- RUN source /code/url.txt
39
- RUN pip3 install https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.2.post1/${FLASH_ATTN_VER} --no-cache-dir
40
 
41
  # Set the working directory to the user's home directory
42
  WORKDIR $HOME/app
 
34
 
35
  RUN pip3 install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
36
  RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
37
+ RUN FLASH_ATTN_VER=$(python /code/get_flash_attn.py) && \
38
+ pip3 install "https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.2.post1/${FLASH_ATTN_VER}" --no-cache-dir
 
39
 
40
  # Set the working directory to the user's home directory
41
  WORKDIR $HOME/app
get_flash_attn.py CHANGED
@@ -54,6 +54,6 @@ def generate_flash_attn_filename(flash_attn_version="2.7.2.post1"):
54
  if __name__ == "__main__":
55
  try:
56
  filename = generate_flash_attn_filename()
57
- print(f"FLASH_ATTN_VER={filename}")
58
  except Exception as e:
59
  print("Error generating filename:", e)
 
54
  if __name__ == "__main__":
55
  try:
56
  filename = generate_flash_attn_filename()
57
+ print(f"{filename}")
58
  except Exception as e:
59
  print("Error generating filename:", e)