Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,14 @@
|
|
1 |
import streamlit as st
|
2 |
import langcodes
|
3 |
from allosaurus.app import read_recognizer
|
|
|
4 |
|
5 |
|
6 |
def get_path_to_wav_format(uploaded_file):
|
7 |
st.write(dir(uploaded_file))
|
8 |
st.write(type(uploaded_file))
|
9 |
if ".wav" in uploaded_file:
|
10 |
-
return uploaded_file
|
11 |
# TODO: .mp3 conversion
|
12 |
|
13 |
|
@@ -48,7 +49,7 @@ if __name__ == "__main__":
|
|
48 |
|
49 |
wav_file = get_path_to_wav_format(uploaded_file)
|
50 |
|
51 |
-
result = model.recognize(
|
52 |
st.write(result)
|
53 |
|
54 |
|
|
|
1 |
import streamlit as st
|
2 |
import langcodes
|
3 |
from allosaurus.app import read_recognizer
|
4 |
+
from pathlib import Path
|
5 |
|
6 |
|
7 |
def get_path_to_wav_format(uploaded_file):
|
8 |
st.write(dir(uploaded_file))
|
9 |
st.write(type(uploaded_file))
|
10 |
if ".wav" in uploaded_file:
|
11 |
+
return path(uploaded_file)
|
12 |
# TODO: .mp3 conversion
|
13 |
|
14 |
|
|
|
49 |
|
50 |
wav_file = get_path_to_wav_format(uploaded_file)
|
51 |
|
52 |
+
result = model.recognize(wav_file, langcode)
|
53 |
st.write(result)
|
54 |
|
55 |
|