Update run.py
Browse files
run.py
CHANGED
@@ -37,21 +37,16 @@ def reformat_freq(sr, y):
|
|
37 |
return sr, y
|
38 |
|
39 |
|
40 |
-
def transcribe(
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
stream.feedAudioContent(y)
|
45 |
-
text = stream.intermediateDecode()
|
46 |
-
return text, stream
|
47 |
|
48 |
|
49 |
demo = gr.Interface(
|
50 |
transcribe,
|
51 |
# [gr.Audio(source="microphone", streaming=True), "state"],
|
52 |
-
gr.Audio(label="Upload Audio File", source="upload", type="filepath")
|
53 |
-
["text", "state"],
|
54 |
-
live=True,
|
55 |
)
|
56 |
|
57 |
if __name__ == "__main__":
|
|
|
37 |
return sr, y
|
38 |
|
39 |
|
40 |
+
def transcribe(audio_file):
|
41 |
+
|
42 |
+
text = model(audio_file)
|
43 |
+
return text
|
|
|
|
|
|
|
44 |
|
45 |
|
46 |
demo = gr.Interface(
|
47 |
transcribe,
|
48 |
# [gr.Audio(source="microphone", streaming=True), "state"],
|
49 |
+
gr.Audio(label="Upload Audio File", source="upload", type="filepath")
|
|
|
|
|
50 |
)
|
51 |
|
52 |
if __name__ == "__main__":
|