Spaces:
Runtime error
Runtime error
Commit
·
d0d56b0
1
Parent(s):
11bb6c0
correct stt defect
Browse files
app.py
CHANGED
|
@@ -98,7 +98,12 @@ def speech_to_text_loc(audio):
|
|
| 98 |
chunk_length_s=30,
|
| 99 |
device=device,
|
| 100 |
)
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
return text
|
| 103 |
|
| 104 |
print("voice to text loc: ", speech_to_text_loc(sample))
|
|
|
|
| 98 |
chunk_length_s=30,
|
| 99 |
device=device,
|
| 100 |
)
|
| 101 |
+
print("type of audio:", type(audio))
|
| 102 |
+
if type(audio) == dict:
|
| 103 |
+
text = pipe(audio.copy(), batch_size=2)["text"]
|
| 104 |
+
else:
|
| 105 |
+
text = pipe(audio, batch_size=2)["text"]
|
| 106 |
+
|
| 107 |
return text
|
| 108 |
|
| 109 |
print("voice to text loc: ", speech_to_text_loc(sample))
|