2Btainment commited on
Commit
df93e11
·
verified ·
1 Parent(s): 83fd0a4

Fix: LFS-Pointer (Texturen/Logo) im Docker-Build durch echte Dateien ersetzen

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -0
Dockerfile CHANGED
@@ -5,6 +5,8 @@ WORKDIR /home/user/app
5
  COPY --chown=user server/requirements.txt server/requirements.txt
6
  RUN pip install --no-cache-dir -r server/requirements.txt
7
  COPY --chown=user . .
 
 
8
  USER user
9
  ENV HF_HUB_DISABLE_TELEMETRY=1 HF_HUB_DISABLE_PROGRESS_BARS=1
10
  EXPOSE 7860
 
5
  COPY --chown=user server/requirements.txt server/requirements.txt
6
  RUN pip install --no-cache-dir -r server/requirements.txt
7
  COPY --chown=user . .
8
+ # HF Docker builds can receive Git-LFS pointer files instead of binaries: fetch any pointer from the Hub
9
+ RUN python -c "import os,urllib.request as u;[u.urlretrieve('https://huggingface.co/spaces/2Btainment/studius/resolve/main/'+os.path.relpath(os.path.join(d,f)),os.path.join(d,f)) for d,_,fs in os.walk('.') for f in fs if os.path.getsize(os.path.join(d,f))<200 and open(os.path.join(d,f),'rb').read(40).startswith(b'version https://git-lfs')]"
10
  USER user
11
  ENV HF_HUB_DISABLE_TELEMETRY=1 HF_HUB_DISABLE_PROGRESS_BARS=1
12
  EXPOSE 7860