Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -66,19 +66,15 @@ st.set_page_config(
|
|
66 |
page_title="YouTube Talks",
|
67 |
page_icon='📽️'
|
68 |
)
|
69 |
-
|
70 |
-
|
71 |
-
st.header('Query YouTube Videos!')
|
72 |
-
thumbnail_placeholder = st.empty()
|
73 |
-
user_query = st.text_input("Query the Video!")
|
74 |
-
video_query_button = st.button("Ask video!")
|
75 |
-
main_ph = st.empty()
|
76 |
-
|
77 |
-
|
78 |
st.sidebar.header("URL details:")
|
79 |
video_url = st.sidebar.text_input("Enter video URL")
|
80 |
submit_button = st.sidebar.button("Submit")
|
|
|
|
|
81 |
progress_updates = st.sidebar.empty()
|
|
|
82 |
|
83 |
# on button press
|
84 |
if submit_button:
|
@@ -120,15 +116,11 @@ if video_query_button:
|
|
120 |
st.sidebar.write(st.session_state.transcription)
|
121 |
thumbnail_placeholder.image(st.session_state.thumbnail_url)
|
122 |
# if video not transcribed display error
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
st.write(st.session_state.chain.invoke(user_query))
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
66 |
page_title="YouTube Talks",
|
67 |
page_icon='📽️'
|
68 |
)
|
69 |
+
st.header('Query YouTube Videos!')
|
70 |
+
thumbnail_placeholder = st.empty()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
st.sidebar.header("URL details:")
|
72 |
video_url = st.sidebar.text_input("Enter video URL")
|
73 |
submit_button = st.sidebar.button("Submit")
|
74 |
+
user_query = st.text_input("Query the Video!")
|
75 |
+
video_query_button = st.button("Ask video!")
|
76 |
progress_updates = st.sidebar.empty()
|
77 |
+
main_ph = st.empty()
|
78 |
|
79 |
# on button press
|
80 |
if submit_button:
|
|
|
116 |
st.sidebar.write(st.session_state.transcription)
|
117 |
thumbnail_placeholder.image(st.session_state.thumbnail_url)
|
118 |
# if video not transcribed display error
|
119 |
+
if st.session_state.chain is None:
|
120 |
+
st.error("Please transcribe a video first by submitting a URL.")
|
121 |
+
else:
|
122 |
+
main_ph.text("Fetching Results...")
|
123 |
+
# print results
|
124 |
+
st.subheader("Result:")
|
125 |
+
main_ph.text("Displaying Results...")
|
126 |
+
st.write(st.session_state.chain.invoke(user_query))
|
|
|
|
|
|
|
|