forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (33 loc) · 1.05 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}
# set the model cache dir
ENV TRANSFORMERS_CACHE=/data/models/huggingface \
HUGGINGFACE_HUB_CACHE=/data/models/huggingface \
HF_HOME=/data/models/huggingface
# add downloader tool
COPY huggingface-downloader /usr/local/bin/
COPY huggingface-downloader.py /usr/local/bin/_huggingface-downloader.py
# install huggingface_hub package (with CLI)
RUN set -ex \
# Fix: ModuleNotFoundError: No module named 'dataclasses' (on JetPack 4) \
&& pip3 install --no-cache-dir --verbose \
huggingface_hub[cli] \
dataclasses \
\
# make sure it loads \
&& huggingface-cli --help \
&& huggingface-downloader --help \
&& pip3 show huggingface_hub \
&& python3 -c 'import huggingface_hub; print(huggingface_hub.__version__)' \
\
# for benchmark timing \
&& apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean