fix syntax

This commit is contained in:
kandrusyak
2026-07-25 15:47:36 +03:00
parent 3f63d0305c
commit c04fb9480b
8 changed files with 56 additions and 32 deletions

View File

@@ -2,7 +2,7 @@ import sys
import threading
import warnings
from pathlib import Path
from typing import Any, Callable, Protocol
from typing import Any, Callable, Protocol, cast
class SpeechRecognitionError(RuntimeError):
@@ -21,9 +21,9 @@ def load_whisper_model_class() -> Any:
missing = object()
loaded_torch = sys.modules.get("torch", missing)
if loaded_torch is missing:
sys.modules["torch"] = None
sys.modules["torch"] = cast(Any, None)
try:
with warnings.catch_warnings():
with warnings.catch_warnings(record=False):
warnings.filterwarnings(
"ignore",
message="pkg_resources is deprecated as an API.*",