Spaces:
Sleeping
Sleeping
Mod: Format file using black and update help msg.
Browse files
app.py
CHANGED
|
@@ -159,7 +159,8 @@ def show_results(outputs: dict[str, Union[dict[str, Any], str]]) -> None:
|
|
| 159 |
f'<center><p class="space"><p class="big-font">"{cand}"</p></p></center>',
|
| 160 |
]
|
| 161 |
|
| 162 |
-
st.markdown(
|
|
|
|
| 163 |
<style>
|
| 164 |
.big-font {
|
| 165 |
font-size:22px !important;
|
|
@@ -167,7 +168,9 @@ def show_results(outputs: dict[str, Union[dict[str, Any], str]]) -> None:
|
|
| 167 |
padding: 10px;
|
| 168 |
}
|
| 169 |
</style>
|
| 170 |
-
""",
|
|
|
|
|
|
|
| 171 |
content = "<br>".join(lines)
|
| 172 |
st.markdown(content, unsafe_allow_html=True)
|
| 173 |
|
|
@@ -207,7 +210,7 @@ def main() -> None:
|
|
| 207 |
f"Audio files are automatically resampled to 32 kHz.\nTheir duration must be in range [{MIN_AUDIO_DURATION_SEC}, {MAX_AUDIO_DURATION_SEC}] seconds.",
|
| 208 |
type=["wav", "flac", "mp3", "ogg", "avi"],
|
| 209 |
accept_multiple_files=True,
|
| 210 |
-
help="
|
| 211 |
)
|
| 212 |
|
| 213 |
with st.expander("Model options"):
|
|
@@ -242,9 +245,11 @@ def main() -> None:
|
|
| 242 |
elif allow_rep_mode == "stopwords":
|
| 243 |
forbid_rep_mode = "content_words"
|
| 244 |
else:
|
| 245 |
-
|
| 246 |
f"Unknown option {allow_rep_mode=}. (expected one of {ALLOW_REP_MODES})"
|
| 247 |
)
|
|
|
|
|
|
|
| 248 |
del allow_rep_mode
|
| 249 |
|
| 250 |
generate_kwds: dict[str, Any] = dict(
|
|
|
|
| 159 |
f'<center><p class="space"><p class="big-font">"{cand}"</p></p></center>',
|
| 160 |
]
|
| 161 |
|
| 162 |
+
st.markdown(
|
| 163 |
+
"""
|
| 164 |
<style>
|
| 165 |
.big-font {
|
| 166 |
font-size:22px !important;
|
|
|
|
| 168 |
padding: 10px;
|
| 169 |
}
|
| 170 |
</style>
|
| 171 |
+
""",
|
| 172 |
+
unsafe_allow_html=True,
|
| 173 |
+
)
|
| 174 |
content = "<br>".join(lines)
|
| 175 |
st.markdown(content, unsafe_allow_html=True)
|
| 176 |
|
|
|
|
| 210 |
f"Audio files are automatically resampled to 32 kHz.\nTheir duration must be in range [{MIN_AUDIO_DURATION_SEC}, {MAX_AUDIO_DURATION_SEC}] seconds.",
|
| 211 |
type=["wav", "flac", "mp3", "ogg", "avi"],
|
| 212 |
accept_multiple_files=True,
|
| 213 |
+
help="Supports wav, flac, mp3, ogg and avi files.",
|
| 214 |
)
|
| 215 |
|
| 216 |
with st.expander("Model options"):
|
|
|
|
| 245 |
elif allow_rep_mode == "stopwords":
|
| 246 |
forbid_rep_mode = "content_words"
|
| 247 |
else:
|
| 248 |
+
msg = (
|
| 249 |
f"Unknown option {allow_rep_mode=}. (expected one of {ALLOW_REP_MODES})"
|
| 250 |
)
|
| 251 |
+
raise ValueError(msg)
|
| 252 |
+
|
| 253 |
del allow_rep_mode
|
| 254 |
|
| 255 |
generate_kwds: dict[str, Any] = dict(
|