Skip to content

Commit 43190e8

Browse files
committed
Suppress unnecessary warnings in Windows bundle
1 parent a0f15c9 commit 43190e8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

taggui/run_gui.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
import traceback
33

4+
import transformers
45
from PySide6.QtGui import QImageReader
56
from PySide6.QtWidgets import QApplication, QMessageBox
67

@@ -23,6 +24,10 @@ def run_gui():
2324

2425

2526
if __name__ == '__main__':
27+
# Suppress warnings when running inside a bundled version of the
28+
# application.
29+
if sys.stdout is None:
30+
transformers.logging.set_verbosity_error()
2631
try:
2732
run_gui()
2833
except Exception as exception:

0 commit comments

Comments
 (0)