Skip to content

Commit 8c88434

Browse files
authored
fix: make HF cache mount point dynamic based on target (#3270)
Signed-off-by: Keiven Chang <[email protected]>
1 parent 74a5667 commit 8c88434

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

container/run.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,13 @@ get_options() {
269269

270270
if [ -n "$HF_CACHE" ]; then
271271
mkdir -p "$HF_CACHE"
272-
VOLUME_MOUNTS+=" -v $HF_CACHE:/root/.cache/huggingface"
272+
# Use /home/ubuntu for local-dev target, /root for dev target.
273+
if [ "$TARGET" = "local-dev" ] || [[ "$IMAGE" == *"local-dev"* ]]; then
274+
HF_CACHE_TARGET="/home/ubuntu/.cache/huggingface"
275+
else
276+
HF_CACHE_TARGET="/root/.cache/huggingface"
277+
fi
278+
VOLUME_MOUNTS+=" -v $HF_CACHE:$HF_CACHE_TARGET"
273279
fi
274280

275281
if [ -z "${PRIVILEGED}" ]; then

0 commit comments

Comments
 (0)