Spaces:
Sleeping
Sleeping
Create setup_environment.py
Browse files- setup_environment.py +12 -0
setup_environment.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import tensorflow as tf
|
3 |
+
import logging
|
4 |
+
|
5 |
+
# Disable oneDNN custom operations if needed
|
6 |
+
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
|
7 |
+
|
8 |
+
# Disable GPU usage (force TensorFlow to use CPU)
|
9 |
+
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
|
10 |
+
|
11 |
+
# Suppress TensorFlow warnings and logs
|
12 |
+
tf.get_logger().setLevel(logging.ERROR)
|