Mr7Explorer commited on
Commit
8029c2b
·
verified ·
1 Parent(s): 309786a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- def load_model():
28
- # Replace with actual class once copied from the BiRefNet repo!
29
- net = BiRefNetDummy()
 
 
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()