diff --git a/Dockerfile b/Dockerfile index b2508a6a8e..5a3a359059 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,10 +59,9 @@ RUN conda create -p /app/env -y python=3.9 SHELL ["conda", "run","--no-capture-output", "-p","/app/env", "/bin/bash", "-c"] RUN conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia && conda clean -ya -RUN pip install xformers COPY --chown=1000:1000 . /app/ RUN pip install -e . -RUN pip install git+https://github.com/huggingface/peft.git -RUN pip install git+https://github.com/huggingface/trl.git + +RUN autotrain setup RUN pip install flash-attn \ No newline at end of file diff --git a/src/autotrain/backend.py b/src/autotrain/backend.py index 5a5d7c57f3..48b8d88225 100644 --- a/src/autotrain/backend.py +++ b/src/autotrain/backend.py @@ -17,6 +17,16 @@ from autotrain.trainers.text_classification.params import TextClassificationParams +_DOCKERFILE = """ +FROM huggingface/autotrain-advanced:latest + +CMD autotrain api --port 7860 --host 0.0.0.0 +""" + +# format _DOCKERFILE +_DOCKERFILE = _DOCKERFILE.replace("\n", " ").replace(" ", "\n").strip() + + def _tabular_munge_data(params, username): if isinstance(params.target_columns, str): col_map_label = [params.target_columns] @@ -327,8 +337,7 @@ def _create_space(self): repo_type="space", ) - _dockerfile = "FROM huggingface/autotrain-advanced:latest\nCMD autotrain setup && autotrain api --port 7860 --host 0.0.0.0" - _dockerfile = io.BytesIO(_dockerfile.encode()) + _dockerfile = io.BytesIO(_DOCKERFILE.encode()) api.upload_file( path_or_fileobj=_dockerfile, path_in_repo="Dockerfile",