asimfayaz commited on
Commit
438b69a
·
1 Parent(s): 1604301

Fixed fork() issue

Browse files
Files changed (1) hide show
  1. gradio_app.py +7 -0
gradio_app.py CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  # Hunyuan 3D is licensed under the TENCENT HUNYUAN NON-COMMERCIAL LICENSE AGREEMENT
2
  # except for the third-party components listed below.
3
  # Hunyuan 3D does not impose any additional limitations beyond what is outlined
 
1
+ # Set OpenMP environment variables to prevent fork() errors
2
+ import os
3
+ os.environ["OMP_NUM_THREADS"] = "1" # Limit OpenMP to single thread
4
+ os.environ["PYTHONFAULTHANDLER"] = "1" # Better error reporting
5
+ os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" # Avoid Intel MKL errors
6
+ os.environ["OMP_THREAD_LIMIT"] = "1" # Limit total number of OpenMP threads
7
+
8
  # Hunyuan 3D is licensed under the TENCENT HUNYUAN NON-COMMERCIAL LICENSE AGREEMENT
9
  # except for the third-party components listed below.
10
  # Hunyuan 3D does not impose any additional limitations beyond what is outlined