fix syntax
This commit is contained in:
@@ -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.*",
|
||||
|
||||
Reference in New Issue
Block a user