tejadhith commited on
Commit
11423f4
·
verified ·
1 Parent(s): 762f92f

Download corpus from HF Space instead of Google Drive

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -6
  2. server/Dockerfile +5 -6
Dockerfile CHANGED
@@ -49,16 +49,15 @@ RUN apt-get update && \
49
  COPY --from=builder /app/env/.venv /app/.venv
50
  COPY --from=builder /app/env /app/env
51
 
52
- # Extract shaders21k corpus from bundled zip (no external download needed)
 
53
  RUN if [ -f /app/env/shader_data.zip ]; then \
54
  python3 -c "import zipfile; zipfile.ZipFile('/app/env/shader_data.zip').extractall('/app/env')" && \
55
  rm /app/env/shader_data.zip; \
56
  elif [ ! -d /app/env/data/shadertoy ]; then \
57
- pip install --no-cache-dir gdown && \
58
- gdown "1kIiBdeW9CEIfRlYOYTuxfWvN036k3Iig" -O /tmp/shaders.zip && \
59
- python3 -c "import zipfile; zipfile.ZipFile('/tmp/shaders.zip').extractall('/app/env')" && \
60
- mv /app/env/shader_codes /app/env/data && \
61
- rm /tmp/shaders.zip; \
62
  fi
63
 
64
  ENV PATH="/app/.venv/bin:$PATH"
 
49
  COPY --from=builder /app/env/.venv /app/.venv
50
  COPY --from=builder /app/env /app/env
51
 
52
+ # Extract shaders21k corpus
53
+ # Priority: bundled zip > already extracted > download from HF Space
54
  RUN if [ -f /app/env/shader_data.zip ]; then \
55
  python3 -c "import zipfile; zipfile.ZipFile('/app/env/shader_data.zip').extractall('/app/env')" && \
56
  rm /app/env/shader_data.zip; \
57
  elif [ ! -d /app/env/data/shadertoy ]; then \
58
+ curl -fSL "https://huggingface.co/spaces/tejadhith/shader/resolve/main/shader_data.zip" -o /tmp/shader_data.zip && \
59
+ python3 -c "import zipfile; zipfile.ZipFile('/tmp/shader_data.zip').extractall('/app/env')" && \
60
+ rm /tmp/shader_data.zip; \
 
 
61
  fi
62
 
63
  ENV PATH="/app/.venv/bin:$PATH"
server/Dockerfile CHANGED
@@ -49,16 +49,15 @@ RUN apt-get update && \
49
  COPY --from=builder /app/env/.venv /app/.venv
50
  COPY --from=builder /app/env /app/env
51
 
52
- # Extract shaders21k corpus from bundled zip (no external download needed)
 
53
  RUN if [ -f /app/env/shader_data.zip ]; then \
54
  python3 -c "import zipfile; zipfile.ZipFile('/app/env/shader_data.zip').extractall('/app/env')" && \
55
  rm /app/env/shader_data.zip; \
56
  elif [ ! -d /app/env/data/shadertoy ]; then \
57
- pip install --no-cache-dir gdown && \
58
- gdown "1kIiBdeW9CEIfRlYOYTuxfWvN036k3Iig" -O /tmp/shaders.zip && \
59
- python3 -c "import zipfile; zipfile.ZipFile('/tmp/shaders.zip').extractall('/app/env')" && \
60
- mv /app/env/shader_codes /app/env/data && \
61
- rm /tmp/shaders.zip; \
62
  fi
63
 
64
  ENV PATH="/app/.venv/bin:$PATH"
 
49
  COPY --from=builder /app/env/.venv /app/.venv
50
  COPY --from=builder /app/env /app/env
51
 
52
+ # Extract shaders21k corpus
53
+ # Priority: bundled zip > already extracted > download from HF Space
54
  RUN if [ -f /app/env/shader_data.zip ]; then \
55
  python3 -c "import zipfile; zipfile.ZipFile('/app/env/shader_data.zip').extractall('/app/env')" && \
56
  rm /app/env/shader_data.zip; \
57
  elif [ ! -d /app/env/data/shadertoy ]; then \
58
+ curl -fSL "https://huggingface.co/spaces/tejadhith/shader/resolve/main/shader_data.zip" -o /tmp/shader_data.zip && \
59
+ python3 -c "import zipfile; zipfile.ZipFile('/tmp/shader_data.zip').extractall('/app/env')" && \
60
+ rm /tmp/shader_data.zip; \
 
 
61
  fi
62
 
63
  ENV PATH="/app/.venv/bin:$PATH"