danielr-ceva commited on
Commit
41e4e7e
·
verified ·
1 Parent(s): 3fcd8a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -112,8 +112,13 @@ def get_ort_session(model_key: str) -> ort.InferenceSession:
112
  spec = MODEL_PRESETS[model_key]
113
  onnx_path = resolve_model_path(spec.onnx_path)
114
 
 
 
 
 
115
  sess = ort.InferenceSession(
116
  onnx_path,
 
117
  providers=["CPUExecutionProvider"],
118
  )
119
  _SESSIONS[model_key] = sess
 
112
  spec = MODEL_PRESETS[model_key]
113
  onnx_path = resolve_model_path(spec.onnx_path)
114
 
115
+ options = ort.SessionOptions()
116
+ options.intra_op_num_threads = 1
117
+ options.inter_op_num_threads = 1
118
+
119
  sess = ort.InferenceSession(
120
  onnx_path,
121
+ sess_options=options,
122
  providers=["CPUExecutionProvider"],
123
  )
124
  _SESSIONS[model_key] = sess