display longer
Browse files
app.py
CHANGED
@@ -81,10 +81,7 @@ def stream_text(url, chunk_duration_ms, pad_duration_ms):
|
|
81 |
def main():
|
82 |
state = st.session_state
|
83 |
st.header("Video ASR Streamlit from Youtube Link")
|
84 |
-
|
85 |
-
# print the lines of subs
|
86 |
-
st.code("\n".join(state.lines))
|
87 |
-
|
88 |
with st.form(key="inputs_form"):
|
89 |
|
90 |
initial_url = "https://youtu.be/ghOqTkGzX7I?t=60"
|
@@ -94,6 +91,10 @@ def main():
|
|
94 |
state.pad_duration_ms = st.slider("Padding duration (ms)", 100, 5000, 1000, 100)
|
95 |
submit_button = st.form_submit_button(label="Submit")
|
96 |
|
|
|
|
|
|
|
|
|
97 |
if submit_button or "asr_stream" not in state:
|
98 |
# a hack to update the video player on value changes
|
99 |
state.youtube_url = (
|
@@ -118,9 +119,7 @@ def main():
|
|
118 |
text = next(state.asr_stream)
|
119 |
state.lines.append(text)
|
120 |
state.chunks_taken += 1
|
121 |
-
|
122 |
-
# print the lines of subs
|
123 |
-
st.code("\n".join(state.lines))
|
124 |
|
125 |
|
126 |
if __name__ == "__main__":
|
|
|
81 |
def main():
|
82 |
state = st.session_state
|
83 |
st.header("Video ASR Streamlit from Youtube Link")
|
84 |
+
|
|
|
|
|
|
|
85 |
with st.form(key="inputs_form"):
|
86 |
|
87 |
initial_url = "https://youtu.be/ghOqTkGzX7I?t=60"
|
|
|
91 |
state.pad_duration_ms = st.slider("Padding duration (ms)", 100, 5000, 1000, 100)
|
92 |
submit_button = st.form_submit_button(label="Submit")
|
93 |
|
94 |
+
if "lines" in state:
|
95 |
+
# print the lines of subs
|
96 |
+
st.code("\n".join(state.lines))
|
97 |
+
|
98 |
if submit_button or "asr_stream" not in state:
|
99 |
# a hack to update the video player on value changes
|
100 |
state.youtube_url = (
|
|
|
119 |
text = next(state.asr_stream)
|
120 |
state.lines.append(text)
|
121 |
state.chunks_taken += 1
|
122 |
+
|
|
|
|
|
123 |
|
124 |
|
125 |
if __name__ == "__main__":
|