Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
1792b56
1
Parent(s):
34b5702
Remove local_dir_use_symlinks in from_pretrained().
Browse files
app.py
CHANGED
@@ -99,7 +99,7 @@ usage_to_weights_file = {
|
|
99 |
'General-dynamic': 'BiRefNet_dynamic',
|
100 |
}
|
101 |
|
102 |
-
birefnet = transformers.AutoModelForImageSegmentation.from_pretrained('/'.join(('zhengpeng7', usage_to_weights_file['General'])), trust_remote_code=True, cache_dir=hf_cache_path
|
103 |
birefnet.to(device)
|
104 |
birefnet.eval(); birefnet.half()
|
105 |
|
@@ -112,7 +112,7 @@ def predict(images, resolution, weights_file):
|
|
112 |
# Load BiRefNet with chosen weights
|
113 |
_weights_file = '/'.join(('zhengpeng7', usage_to_weights_file[weights_file] if weights_file is not None else usage_to_weights_file['General']))
|
114 |
print('Using weights: {}.'.format(_weights_file))
|
115 |
-
birefnet = transformers.AutoModelForImageSegmentation.from_pretrained(_weights_file, trust_remote_code=True, cache_dir=hf_cache_path
|
116 |
birefnet.to(device)
|
117 |
birefnet.eval(); birefnet.half()
|
118 |
|
|
|
99 |
'General-dynamic': 'BiRefNet_dynamic',
|
100 |
}
|
101 |
|
102 |
+
birefnet = transformers.AutoModelForImageSegmentation.from_pretrained('/'.join(('zhengpeng7', usage_to_weights_file['General'])), trust_remote_code=True, cache_dir=hf_cache_path)
|
103 |
birefnet.to(device)
|
104 |
birefnet.eval(); birefnet.half()
|
105 |
|
|
|
112 |
# Load BiRefNet with chosen weights
|
113 |
_weights_file = '/'.join(('zhengpeng7', usage_to_weights_file[weights_file] if weights_file is not None else usage_to_weights_file['General']))
|
114 |
print('Using weights: {}.'.format(_weights_file))
|
115 |
+
birefnet = transformers.AutoModelForImageSegmentation.from_pretrained(_weights_file, trust_remote_code=True, cache_dir=hf_cache_path)
|
116 |
birefnet.to(device)
|
117 |
birefnet.eval(); birefnet.half()
|
118 |
|