Spaces:
Runtime error
Runtime error
set default selection
Browse files
app.py
CHANGED
@@ -60,10 +60,15 @@ def get_langcode_description(input_code):
|
|
60 |
if __name__ == "__main__":
|
61 |
# input_code = st.text_input("(optional) 2 or 3-letter ISO code for input language. 2-letter codes will be converted to 3-letter codes", max_chars=3)
|
62 |
supported_codes = get_supported_codes()
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
model = read_recognizer()
|
66 |
-
|
67 |
|
68 |
st.write(f"Instructing Allosaurus to recognize using language {langcode}. That is, {description}")
|
69 |
|
|
|
60 |
if __name__ == "__main__":
|
61 |
# input_code = st.text_input("(optional) 2 or 3-letter ISO code for input language. 2-letter codes will be converted to 3-letter codes", max_chars=3)
|
62 |
supported_codes = get_supported_codes()
|
63 |
+
index_of_desired_default = supported_codes.index("ipa")
|
64 |
+
langcode = st.selectbox("ISO code for input language. Allosaurus doesn't need this, but it can improve accuracy",
|
65 |
+
options=supported_codes,
|
66 |
+
index=index_of_desired_default,
|
67 |
+
format_func=get_langcode_description
|
68 |
+
)
|
69 |
|
70 |
model = read_recognizer()
|
71 |
+
description = get_langcode_description(langcode)
|
72 |
|
73 |
st.write(f"Instructing Allosaurus to recognize using language {langcode}. That is, {description}")
|
74 |
|