ginipick commited on
Commit
5f17485
·
verified ·
1 Parent(s): 49cebed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -4,10 +4,18 @@ import random
4
  import torch
5
  from PIL import Image
6
  import os
 
 
7
 
8
  import spaces
9
 
10
- # 수정: 명시적으로 snapshot_download 임포트 추가
 
 
 
 
 
 
11
  from huggingface_hub import snapshot_download, hf_hub_download, model_info
12
 
13
  from transformers import CLIPVisionModelWithProjection, CLIPImageProcessor
 
4
  import torch
5
  from PIL import Image
6
  import os
7
+ import sys
8
+ import importlib.util
9
 
10
  import spaces
11
 
12
+ # 중요: 패치 적용 - huggingface_hub에 cached_download 함수 추가
13
+ import huggingface_hub
14
+ if not hasattr(huggingface_hub, "cached_download"):
15
+ # 기존 hf_hub_download 함수를 cached_download로 별칭 추가
16
+ huggingface_hub.cached_download = huggingface_hub.hf_hub_download
17
+
18
+ # 그 후 나머지 임포트 진행
19
  from huggingface_hub import snapshot_download, hf_hub_download, model_info
20
 
21
  from transformers import CLIPVisionModelWithProjection, CLIPImageProcessor