Medvira commited on
Commit
cb4a821
·
verified ·
1 Parent(s): 8a69b3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -23,7 +23,7 @@ session = ort.InferenceSession(model_path)
23
  # Define the inference function
24
  def inference(sample_name):
25
  sample_path = os.path.join(os.getcwd(),'samples', f'{sample_name}.pth')
26
- sample = torch.load(sample_path)
27
  age = sample['boneage'].item()
28
  outputs = session.run(None, {"input": sample['path'].numpy()})
29
  predicted_age = (outputs[0]*41.172)+127.329
 
23
  # Define the inference function
24
  def inference(sample_name):
25
  sample_path = os.path.join(os.getcwd(),'samples', f'{sample_name}.pth')
26
+ sample = torch.load(sample_path, weights_only=False, map_location="cpu")
27
  age = sample['boneage'].item()
28
  outputs = session.run(None, {"input": sample['path'].numpy()})
29
  predicted_age = (outputs[0]*41.172)+127.329