Spaces:
Runtime error
Runtime error
on1onmangoes
commited on
Commit
•
b2204c7
1
Parent(s):
e42b300
Update app.py
Browse files
app.py
CHANGED
@@ -15,10 +15,17 @@ st.markdown("---",unsafe_allow_html=True)
|
|
15 |
audio=st.file_uploader("Upload Your Audio File", type=['mp3','wav','m4a'])
|
16 |
|
17 |
if audio:
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
|
24 |
# chunks=silence.split_on_silence(audio_segment, min_silence_len=500, silence_thresh= audio_segment.dBFS-20,keep_silence=100)
|
|
|
15 |
audio=st.file_uploader("Upload Your Audio File", type=['mp3','wav','m4a'])
|
16 |
|
17 |
if audio:
|
18 |
+
|
19 |
+
pipe = pipeline(model="facebook/wav2vec2-base-960h")
|
20 |
+
# stride_length_s is a tuple of the left and right stride length.
|
21 |
+
# With only 1 number, both sides get the same stride, by default
|
22 |
+
# the stride_length on one side is 1/6th of the chunk_length_s
|
23 |
+
output = pipe("very_long_file.mp3", chunk_length_s=10, stride_length_s=(4, 2))
|
24 |
+
st.json(output)
|
25 |
+
# audio_segment= AudioSegment.from_file(audio)
|
26 |
+
# asr = pipeline('automatic-speech-recognition')
|
27 |
+
# asr_out = asr (audio_segment)
|
28 |
+
# st.json(asr_out)
|
29 |
|
30 |
|
31 |
# chunks=silence.split_on_silence(audio_segment, min_silence_len=500, silence_thresh= audio_segment.dBFS-20,keep_silence=100)
|