Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse filesGunakan thread CPU yang lebih banyak
- 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
|