Julia-Amadio commited on
Commit
33b7f26
·
1 Parent(s): 6972de4

Tentando corrigir erro de cache com pymatting.

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -1
Dockerfile CHANGED
@@ -18,7 +18,19 @@ RUN pip install --no-cache-dir -r requirements.txt
18
 
19
  #PRÉ-BAIXA OS MODELOS (CONVNEXT-LARGE)
20
  RUN python -c "from huggingface_hub import snapshot_download; print('Downloading ConvNext models (snapshot)...'); snapshot_download(repo_id='facebook/convnext-large-224-22k-1k'); print('ConvNext models downloaded.')"
21
- RUN python -c "import backgroundremover; from PIL import Image; print('Downloading backgroundremover model (u2net)...'); img = Image.new('RGB', (1, 1), 'black'); try: backgroundremover.remove(img); except Exception: pass; print('Model download triggered.')"
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  #Copia o código da aplicação
24
  COPY . .
 
18
 
19
  #PRÉ-BAIXA OS MODELOS (CONVNEXT-LARGE)
20
  RUN python -c "from huggingface_hub import snapshot_download; print('Downloading ConvNext models (snapshot)...'); snapshot_download(repo_id='facebook/convnext-large-224-22k-1k'); print('ConvNext models downloaded.')"
21
+ #CORREÇÃO: Força o download do backgroundremover com imagem dummy
22
+ #(Usando sintaxe de múltiplas linhas para o 'try...except')
23
+ RUN python -c """
24
+ import backgroundremover
25
+ from PIL import Image
26
+ print('Downloading backgroundremover model (u2net)...')
27
+ img = Image.new('RGB', (1, 1), 'black')
28
+ try:
29
+ backgroundremover.remove(img)
30
+ except Exception:
31
+ pass
32
+ print('Model download triggered.')
33
+ """
34
 
35
  #Copia o código da aplicação
36
  COPY . .