Commit
·
84d2d73
1
Parent(s):
13450c5
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from speechbox import PunctuationRestorer
|
2 |
-
import
|
3 |
import subprocess
|
4 |
import gradio as gr
|
5 |
|
@@ -20,7 +20,7 @@ def convert_to_wav(path):
|
|
20 |
def restore(audio, original_transcript):
|
21 |
path, error = convert_to_wav(audio)
|
22 |
print(error)
|
23 |
-
data, samplerate =
|
24 |
|
25 |
text, _ = restorer(data, original_transcript, samplerate, num_beams=1)
|
26 |
|
@@ -37,4 +37,4 @@ gr.Interface(
|
|
37 |
outputs=[
|
38 |
gr.outputs.Textbox(label='Restored text'),
|
39 |
]
|
40 |
-
).launch()
|
|
|
1 |
from speechbox import PunctuationRestorer
|
2 |
+
import librosa
|
3 |
import subprocess
|
4 |
import gradio as gr
|
5 |
|
|
|
20 |
def restore(audio, original_transcript):
|
21 |
path, error = convert_to_wav(audio)
|
22 |
print(error)
|
23 |
+
data, samplerate = librosa.load(path, sr=16_000)
|
24 |
|
25 |
text, _ = restorer(data, original_transcript, samplerate, num_beams=1)
|
26 |
|
|
|
37 |
outputs=[
|
38 |
gr.outputs.Textbox(label='Restored text'),
|
39 |
]
|
40 |
+
).launch()
|