Skip to content

Commit d107404

Browse files
committed
revert warnings placement
1 parent b53e160 commit d107404

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

wtpsplit/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
from pathlib import Path
66
from typing import Literal
77

8-
# suppress docopt syntax warnings (triggered in Python 3.14+)
9-
warnings.filterwarnings("ignore", category=SyntaxWarning, module="docopt")
10-
# suppress torchaudio backend dispatch warning (triggered by skops)
11-
warnings.filterwarnings("ignore", category=UserWarning, message="Torchaudio's I/O functions now support.*")
12-
13-
warnings.simplefilter("default", DeprecationWarning) # show by default
14-
warnings.simplefilter("ignore", category=FutureWarning) # for tranformers
15-
168
# avoid the "None of PyTorch, TensorFlow, etc. have been found" warning.
179
with contextlib.redirect_stderr(open(os.devnull, "w")):
1810
import transformers # noqa
@@ -29,6 +21,14 @@
2921

3022
__version__ = "2.1.7"
3123

24+
# suppress docopt syntax warnings (triggered in Python 3.14+)
25+
warnings.filterwarnings("ignore", category=SyntaxWarning, module="docopt")
26+
# suppress torchaudio backend dispatch warning (triggered by skops)
27+
warnings.filterwarnings("ignore", category=UserWarning, message="Torchaudio's I/O functions now support.*")
28+
29+
warnings.simplefilter("default", DeprecationWarning) # show by default
30+
warnings.simplefilter("ignore", category=FutureWarning) # for tranformers
31+
3232
class WtP:
3333
def __init__(
3434
self,

0 commit comments

Comments
 (0)