Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekkrthakur committed Oct 4, 2023
1 parent 740b74f commit cea8675
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 11 additions & 2 deletions src/autotrain/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit cea8675

Please sign in to comment.