JonathanFhima commited on
Commit
16882cd
·
verified ·
1 Parent(s): 8e3e4ca

Load the model config from the single root config.yaml instead of weights/model.yaml

Browse files
Files changed (1) hide show
  1. infer.py +2 -2
infer.py CHANGED
@@ -24,10 +24,10 @@ MASK_ALPHA = 0.65
24
 
25
 
26
  def load_model(weights_dir, device):
27
- """Build the segmenter from model.yaml and load model.safetensors.
28
 
29
  Loaded in bfloat16: that's the precision the model was trained in."""
30
- model = Swinv2Segmenter(weights_dir / "model.yaml")
31
  load_safetensors(model, weights_dir / "model.safetensors")
32
  return model.to(device).to(torch.bfloat16).eval()
33
 
 
24
 
25
 
26
  def load_model(weights_dir, device):
27
+ """Build the segmenter from config.yaml (repo root) and load model.safetensors.
28
 
29
  Loaded in bfloat16: that's the precision the model was trained in."""
30
+ model = Swinv2Segmenter(weights_dir.parent / "config.yaml")
31
  load_safetensors(model, weights_dir / "model.safetensors")
32
  return model.to(device).to(torch.bfloat16).eval()
33