File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828warnings .filterwarnings ('ignore' , message = '.*Triton.*' )
2929warnings .filterwarnings ('ignore' , module = 'xformers' )
3030
31+ # 抑制 xformers 导入时的 Triton 警告(这些是直接打印到 stdout 的)
32+ import io
33+ import contextlib
34+
35+ # 临时重定向 stdout 和 stderr 来抑制 xformers 的 Triton 警告
36+ _original_stdout = sys .stdout
37+ _original_stderr = sys .stderr
38+ sys .stdout = io .StringIO ()
39+ sys .stderr = io .StringIO ()
40+
3141from PyQt6 .QtWidgets import QApplication
3242from main_window import MainWindow
3343from services import init_services
3444
45+ # 恢复 stdout 和 stderr(xformers 已经导入完成)
46+ sys .stdout = _original_stdout
47+ sys .stderr = _original_stderr
48+
3549def print_memory_snapshot ():
3650 """打印内存快照(前100行)"""
3751 snapshot = tracemalloc .take_snapshot ()
Original file line number Diff line number Diff line change @@ -102,7 +102,6 @@ def _load_stylesheet(self):
102102
103103 # 获取主题设置,Pydantic会自动使用默认值'light'
104104 theme = config .app .theme
105- print (f"[DEBUG] 加载主题: { theme } " )
106105 self ._apply_theme (theme )
107106
108107 def _apply_theme (self , theme : str ):
You can’t perform that action at this time.
0 commit comments