Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -75,6 +75,9 @@ usage_to_weights_file = {
|
|
75 |
'General-legacy': 'BiRefNet-legacy'
|
76 |
}
|
77 |
|
|
|
|
|
|
|
78 |
# 초기 모델 로딩 (기본: General)
|
79 |
birefnet = AutoModelForImageSegmentation.from_pretrained(
|
80 |
'/'.join(('zhengpeng7', usage_to_weights_file['General'])),
|
@@ -158,7 +161,6 @@ def predict(images, resolution, weights_file):
|
|
158 |
zipf.write(file, os.path.basename(file))
|
159 |
return save_paths, zip_file_path
|
160 |
else:
|
161 |
-
# 반환값을 리스트 형태로 만들어 ImageSlider에서 표시되도록 함.
|
162 |
return outputs
|
163 |
|
164 |
# 예제 데이터 (이미지, URL, 배치)
|
|
|
75 |
'General-legacy': 'BiRefNet-legacy'
|
76 |
}
|
77 |
|
78 |
+
# 모델 로딩 전에 tie_weights()를 빈 함수로 재정의(우회)
|
79 |
+
AutoModelForImageSegmentation.tie_weights = lambda self: None
|
80 |
+
|
81 |
# 초기 모델 로딩 (기본: General)
|
82 |
birefnet = AutoModelForImageSegmentation.from_pretrained(
|
83 |
'/'.join(('zhengpeng7', usage_to_weights_file['General'])),
|
|
|
161 |
zipf.write(file, os.path.basename(file))
|
162 |
return save_paths, zip_file_path
|
163 |
else:
|
|
|
164 |
return outputs
|
165 |
|
166 |
# 예제 데이터 (이미지, URL, 배치)
|