Remove warnings suppression for multiprocessing in run scripts
- Eliminated unnecessary warnings suppression related to multiprocessing resource tracking in `run.py` and `run_parallel_simulation.py`, streamlining the code and reducing potential confusion. - This change enhances clarity in logging by allowing relevant warnings to be displayed during execution, improving traceability and debugging capabilities.
This commit is contained in:
parent
91eb73ae44
commit
78230b7b38
2 changed files with 0 additions and 13 deletions
|
|
@ -4,17 +4,6 @@ MiroFish Backend 启动入口
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
|
||||||
|
|
||||||
# 抑制 multiprocessing resource_tracker 的警告(来自第三方库如 transformers)
|
|
||||||
# 这个警告是无害的,只是在进程被终止时资源没有被正确清理
|
|
||||||
warnings.filterwarnings("ignore", message=".*resource_tracker.*")
|
|
||||||
warnings.filterwarnings("ignore", category=UserWarning, module=".*multiprocessing.*")
|
|
||||||
|
|
||||||
# 额外:通过环境变量告诉 Python 不要跟踪 multiprocessing 资源
|
|
||||||
# 这可以从根本上避免警告
|
|
||||||
import os
|
|
||||||
os.environ.setdefault('PYTHONWARNINGS', 'ignore::UserWarning')
|
|
||||||
|
|
||||||
# 添加项目根目录到路径
|
# 添加项目根目录到路径
|
||||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,6 @@ import warnings
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Dict, Any, List, Optional, Tuple
|
from typing import Dict, Any, List, Optional, Tuple
|
||||||
|
|
||||||
# 抑制 multiprocessing resource_tracker 的警告(来自第三方库如 transformers)
|
|
||||||
warnings.filterwarnings("ignore", message=".*resource_tracker.*")
|
|
||||||
|
|
||||||
# 全局变量:用于信号处理
|
# 全局变量:用于信号处理
|
||||||
_shutdown_event = None
|
_shutdown_event = None
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue