Spaces:
Sleeping
Sleeping
copilot-swe-agent[bot] raylim commited on
Commit ·
984090e
1
Parent(s): c0cda2e
Improve CSV handling and add documentation notes
Browse filesCo-authored-by: raylim <3074310+raylim@users.noreply.github.com>
- README-docker.md +5 -0
- mosaic +8 -5
README-docker.md
CHANGED
|
@@ -120,6 +120,11 @@ The `mosaic` wrapper script:
|
|
| 120 |
- Handles the HF_TOKEN environment variable
|
| 121 |
- Detects and uses GPU support if available (falls back to CPU if not)
|
| 122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
#### Requirements for CLI usage
|
| 124 |
|
| 125 |
- Docker installed and running
|
|
|
|
| 120 |
- Handles the HF_TOKEN environment variable
|
| 121 |
- Detects and uses GPU support if available (falls back to CPU if not)
|
| 122 |
|
| 123 |
+
**Note**: When using `--slide-csv`, the script mounts the directory containing the CSV file.
|
| 124 |
+
For slides referenced in the CSV, they should be in the same directory as the CSV file or in
|
| 125 |
+
subdirectories relative to it. If slides are in different locations, you may need to modify
|
| 126 |
+
the CSV to use relative paths or run the docker command directly with additional volume mounts.
|
| 127 |
+
|
| 128 |
#### Requirements for CLI usage
|
| 129 |
|
| 130 |
- Docker installed and running
|
mosaic
CHANGED
|
@@ -15,6 +15,10 @@
|
|
| 15 |
# - NVIDIA Docker runtime (for GPU support)
|
| 16 |
# - HF_TOKEN environment variable set
|
| 17 |
# - Docker image pulled: docker pull tomp/mosaic-gradio
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
DOCKER_IMAGE="tomp/mosaic-gradio"
|
| 20 |
USE_GPU=true
|
|
@@ -66,12 +70,11 @@ while [[ $# -gt 0 ]]; do
|
|
| 66 |
CSV_PATH=$(readlink -f "$CSV_PATH")
|
| 67 |
CSV_DIR=$(dirname "$CSV_PATH")
|
| 68 |
CSV_FILE=$(basename "$CSV_PATH")
|
| 69 |
-
# Mount the directory
|
| 70 |
-
|
|
|
|
| 71 |
# Pass the container path to mosaic
|
| 72 |
-
ARGS+=("--slide-csv" "/mnt/
|
| 73 |
-
# Note: CSV may reference slide paths that also need to be mounted
|
| 74 |
-
# For simplicity, we assume slides are in same dir or subdirs
|
| 75 |
fi
|
| 76 |
shift
|
| 77 |
;;
|
|
|
|
| 15 |
# - NVIDIA Docker runtime (for GPU support)
|
| 16 |
# - HF_TOKEN environment variable set
|
| 17 |
# - Docker image pulled: docker pull tomp/mosaic-gradio
|
| 18 |
+
#
|
| 19 |
+
# Note: When using --slide-csv, the CSV file and all referenced slides should be
|
| 20 |
+
# in the same directory tree. Slides can be in subdirectories relative to
|
| 21 |
+
# the CSV file location.
|
| 22 |
|
| 23 |
DOCKER_IMAGE="tomp/mosaic-gradio"
|
| 24 |
USE_GPU=true
|
|
|
|
| 70 |
CSV_PATH=$(readlink -f "$CSV_PATH")
|
| 71 |
CSV_DIR=$(dirname "$CSV_PATH")
|
| 72 |
CSV_FILE=$(basename "$CSV_PATH")
|
| 73 |
+
# Mount the parent directory of CSV (to allow slides in subdirs)
|
| 74 |
+
# This allows the CSV to reference slides with relative paths
|
| 75 |
+
VOLUME_MOUNTS+=("-v" "$CSV_DIR:/mnt/data:ro")
|
| 76 |
# Pass the container path to mosaic
|
| 77 |
+
ARGS+=("--slide-csv" "/mnt/data/$CSV_FILE")
|
|
|
|
|
|
|
| 78 |
fi
|
| 79 |
shift
|
| 80 |
;;
|