achmadichzan commited on
Commit
eee8323
·
verified ·
1 Parent(s): 82d45e1

Update src/streamlit_app.py

Browse files

Gunakan thread CPU yang lebih banyak

Files changed (1) hide show
  1. src/streamlit_app.py +6 -0
src/streamlit_app.py CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  import streamlit as st
2
  import cv2
3
  import tempfile
 
1
+ import os
2
+ # Memaksa OpenMP dan ONNX Runtime untuk menggunakan lebih banyak thread CPU
3
+ os.environ["OMP_NUM_THREADS"] = "4"
4
+ os.environ["MKL_NUM_THREADS"] = "4"
5
+ os.environ["NUMEXPR_NUM_THREADS"] = "4"
6
+
7
  import streamlit as st
8
  import cv2
9
  import tempfile