Mojmir commited on
Commit
e1514f1
1 Parent(s): aca7d32
Files changed (2) hide show
  1. .DS_Store +0 -0
  2. app.py +6 -4
.DS_Store ADDED
Binary file (6.15 kB). View file
 
app.py CHANGED
@@ -24,10 +24,12 @@ def load_model(model_path, device):
24
 
25
  def load_secure_model(model):
26
  print("Compiling secure model...")
27
- secure_model = compile_torch_model(model.to("cpu"),
28
- n_bits={"model_inputs": 4, "op_inputs": 3, "op_weights": 3, "model_outputs": 5},
29
- rounding_threshold_bits={"n_bits": 7},
30
- torch_inputset=torch.rand(10, 3, 224, 224))
 
 
31
  return secure_model
32
 
33
  # Image preprocessing (match with the transforms used during training)
 
24
 
25
  def load_secure_model(model):
26
  print("Compiling secure model...")
27
+ secure_model = compile_torch_model(
28
+ model.to("cpu"),
29
+ n_bits={"model_inputs": 4, "op_inputs": 3, "op_weights": 3, "model_outputs": 5},
30
+ rounding_threshold_bits={"n_bits": 7, "method": "APPROXIMATE"},
31
+ torch_inputset=torch.rand(10, 3, 224, 224)
32
+ )
33
  return secure_model
34
 
35
  # Image preprocessing (match with the transforms used during training)