Spaces:
Running on Zero
Running on Zero
Commit ·
4727f1c
1
Parent(s): 74c401a
Upd byte handler
Browse files
app.py
CHANGED
|
@@ -67,7 +67,10 @@ def _robust_transcribe_array(audio_array: np.ndarray, sr: int, task: str) -> str
|
|
| 67 |
|
| 68 |
def _robust_transcribe_path(path: str, task: str) -> str:
|
| 69 |
sr = pipe.feature_extractor.sampling_rate
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
| 71 |
try:
|
| 72 |
return _robust_transcribe_array(audio, sr, task)
|
| 73 |
except Exception as e:
|
|
|
|
| 67 |
|
| 68 |
def _robust_transcribe_path(path: str, task: str) -> str:
|
| 69 |
sr = pipe.feature_extractor.sampling_rate
|
| 70 |
+
# ffmpeg_read expects raw bytes, not a file path
|
| 71 |
+
with open(path, "rb") as _f:
|
| 72 |
+
payload = _f.read()
|
| 73 |
+
audio = ffmpeg_read(payload, sr)
|
| 74 |
try:
|
| 75 |
return _robust_transcribe_array(audio, sr, task)
|
| 76 |
except Exception as e:
|