Spaces:
Running
on
Zero
Running
on
Zero
Update withanyone/flux/model.py
Browse files- withanyone/flux/model.py +2 -1
withanyone/flux/model.py
CHANGED
|
@@ -144,7 +144,8 @@ class SiglipEmbedding(nn.Module):
|
|
| 144 |
super().__init__()
|
| 145 |
self.model = SiglipModel.from_pretrained(siglip_path).vision_model.to(torch.bfloat16)
|
| 146 |
self.processor = AutoProcessor.from_pretrained(siglip_path)
|
| 147 |
-
self.model.to(torch.cuda.current_device())
|
|
|
|
| 148 |
|
| 149 |
# BiRefNet matting setup
|
| 150 |
self.use_matting = use_matting
|
|
|
|
| 144 |
super().__init__()
|
| 145 |
self.model = SiglipModel.from_pretrained(siglip_path).vision_model.to(torch.bfloat16)
|
| 146 |
self.processor = AutoProcessor.from_pretrained(siglip_path)
|
| 147 |
+
# self.model.to(torch.cuda.current_device())
|
| 148 |
+
self.model.to("cuda" if torch.cuda.is_available() else "cpu", dtype=torch.bfloat16)
|
| 149 |
|
| 150 |
# BiRefNet matting setup
|
| 151 |
self.use_matting = use_matting
|