Spaces:
Runtime error
Runtime error
File size: 1,440 Bytes
436a716 1841f2d 4ebb67f 643b232 cff92f7 436a716 cff92f7 436a716 930d942 436a716 cff92f7 99fd5dc 7f5e62c 99fd5dc 7f5e62c cff92f7 436a716 cff92f7 436a716 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
FROM python:3.9
# Select which LRG Model Repo to view. Set this back to a placeholder value to remove viewing repo in the space. ex:
# ENV HF_REPO_ID=LocalResearchGroup/smollm2-135m-20250224_023514
# ENV HF_REPO_ID=xxxxx
ENV HF_REPO_ID=xxxxx
RUN useradd -m -u 1000 aim_user
# Switch to the "aim_user" user
USER aim_user
# Set home to the user's home directory
ENV HOME=/home/aim_user \
PATH=/home/aim_user/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME
# install the `aim` package on the latest version
RUN pip install aim huggingface-hub
#RUN aim telemetry off
ENTRYPOINT ["/bin/sh", "-c"]
# COPY aim_repo.tar.gz .
# RUN tar xvzf aim_repo.tar.gz
# Expose the secret HF_TOKEN at buildtime and use its value as a Bearer token for a curl request
# RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
# curl test -H 'Authorization: Bearer $(cat /run/secrets/HF_TOKEN)'
COPY download_aim.py .
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
python3 download_aim.py
# have to run `aim init` in the directory that stores aim data for
# otherwise `aim up` will prompt for confirmation to create the directory itself.
# We run aim listening on 0.0.0.0 to expose all ports. Also, we run
# using `--dev` to print verbose logs. Port 43800 is the default port of
# `aim up` but explicit is better than implicit.
CMD ["aim up --host 0.0.0.0 --port 7860 --workers 2"]
|