Spaces:
Running
on
Zero
Running
on
Zero
copilot-swe-agent[bot]
raylim
commited on
Commit
·
1e5576e
1
Parent(s):
984090e
Add user ID and group ID to Docker commands for correct file ownership
Browse files- mosaic +5 -0
- run_mosaic_docker.sh +5 -0
mosaic
CHANGED
|
@@ -114,8 +114,13 @@ if [ "$USE_GPU" = true ]; then
|
|
| 114 |
GPU_ARGS+=("--gpus=all" "--runtime=nvidia")
|
| 115 |
fi
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
docker run --rm \
|
| 118 |
"${GPU_ARGS[@]}" \
|
|
|
|
| 119 |
--env HF_TOKEN="${HF_TOKEN}" \
|
| 120 |
--shm-size=500m \
|
| 121 |
"${VOLUME_ARGS[@]}" \
|
|
|
|
| 114 |
GPU_ARGS+=("--gpus=all" "--runtime=nvidia")
|
| 115 |
fi
|
| 116 |
|
| 117 |
+
# Get current user ID and group ID to ensure output files have correct ownership
|
| 118 |
+
USER_ID=$(id -u)
|
| 119 |
+
GROUP_ID=$(id -g)
|
| 120 |
+
|
| 121 |
docker run --rm \
|
| 122 |
"${GPU_ARGS[@]}" \
|
| 123 |
+
--user "${USER_ID}:${GROUP_ID}" \
|
| 124 |
--env HF_TOKEN="${HF_TOKEN}" \
|
| 125 |
--shm-size=500m \
|
| 126 |
"${VOLUME_ARGS[@]}" \
|
run_mosaic_docker.sh
CHANGED
|
@@ -43,8 +43,13 @@ echo
|
|
| 43 |
echo "You may need to wait a minute or so for the models to download before the site appears."
|
| 44 |
echo
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
docker run -it \
|
| 47 |
--gpus=all --runtime=nvidia \
|
|
|
|
| 48 |
--env HF_TOKEN=${HF_TOKEN} \
|
| 49 |
--shm-size=500m \
|
| 50 |
-p ${MOSAIC_PORT}:7860 \
|
|
|
|
| 43 |
echo "You may need to wait a minute or so for the models to download before the site appears."
|
| 44 |
echo
|
| 45 |
|
| 46 |
+
# Get current user ID and group ID to ensure files have correct ownership
|
| 47 |
+
USER_ID=$(id -u)
|
| 48 |
+
GROUP_ID=$(id -g)
|
| 49 |
+
|
| 50 |
docker run -it \
|
| 51 |
--gpus=all --runtime=nvidia \
|
| 52 |
+
--user "${USER_ID}:${GROUP_ID}" \
|
| 53 |
--env HF_TOKEN=${HF_TOKEN} \
|
| 54 |
--shm-size=500m \
|
| 55 |
-p ${MOSAIC_PORT}:7860 \
|