Commit 1da2bd1

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-07-31 09:01:13
fix(asr): fix `get_file_bytes` function to return bytes directly
1 parent f03b9bb
Changed files (1)
src
src/asr/utils.py
@@ -119,7 +119,7 @@ def audio_duration(path: str | Path) -> float:
 async def get_file_bytes(path_or_bytes: str | Path | bytes) -> bytes:
     file_bytes = b""
     if isinstance(path_or_bytes, bytes):
-        return b""
+        return path_or_bytes
     if isinstance(path_or_bytes, (str, Path)):
         if not Path(path_or_bytes).is_file():
             logger.error(f"{path_or_bytes} is not exist.")