Skip to content

Commit 6f85a18

Browse files
committed
Fix type hint in _preprocess method and add a blank line for readability
1 parent c4b4729 commit 6f85a18

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

banglaspeech2text/speech2text.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# Get a child logger that inherits from the main logger
1414
logger = logging.getLogger("BanglaSpeech2Text.speech2text")
1515

16+
1617
class Speech2Text(WhisperModel):
1718
def __init__(
1819
self,
@@ -95,7 +96,7 @@ def recognize(
9596
else:
9697
return "".join([segment.text for segment in segments])
9798

98-
def _preprocess(self, audio: Any) -> str | BinaryIO | ndarray:
99+
def _preprocess(self, audio: Any) -> Union[str, BinaryIO, ndarray]:
99100
class_name = audio.__class__.__name__
100101
temp_file = Path(get_app_temp_dir()) / f"{random.randint(0, 100000)}.wav"
101102
if class_name == "AudioData": # from speech_recognition

0 commit comments

Comments
 (0)