forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (30 loc) · 1.06 KB
/
Dockerfile
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
#---
# name: huggingface_hub
# group: llm
# depends: [python]
# test: test.py
# notes: provides `huggingface-cli` and `huggingface-downloader` tools
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
# install huggingface_hub package (with CLI)
RUN pip3 install --no-cache-dir --verbose huggingface_hub[cli]
# ModuleNotFoundError: No module named 'dataclasses' (on JetPack 4)
RUN pip3 install --no-cache-dir --verbose dataclasses
# set the model cache dir
ENV TRANSFORMERS_CACHE=/data/models/huggingface
ENV HUGGINGFACE_HUB_CACHE=/data/models/huggingface
ENV HF_HOME=/data/models/huggingface
# add downloader tool
COPY huggingface-downloader /usr/local/bin/
COPY huggingface-downloader.py /usr/local/bin/_huggingface-downloader.py
# make sure it loads
RUN huggingface-cli --help && \
huggingface-downloader --help && \
pip3 show huggingface_hub && \
python3 -c 'import huggingface_hub; print(huggingface_hub.__version__)'
# for benchmark timing
RUN apt-get update && \
apt-get install -y --no-install-recommends time \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean