Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,9 +24,11 @@ class BiRefNetDummy(torch.nn.Module):
|
|
| 24 |
# Will be replaced by actual model code in the next step.
|
| 25 |
return torch.ones_like(x)
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
net =
|
|
|
|
|
|
|
| 30 |
return net
|
| 31 |
|
| 32 |
bi_ref_net = load_model()
|
|
|
|
| 24 |
# Will be replaced by actual model code in the next step.
|
| 25 |
return torch.ones_like(x)
|
| 26 |
|
| 27 |
+
ddef load_model():
|
| 28 |
+
download_weights()
|
| 29 |
+
net = BiRefNet()
|
| 30 |
+
net.load_state_dict(torch.load("BiRefNet.pth", map_location="cpu"))
|
| 31 |
+
net.eval()
|
| 32 |
return net
|
| 33 |
|
| 34 |
bi_ref_net = load_model()
|