the-confused-coder commited on
Commit
4905a09
·
verified ·
1 Parent(s): 0d61baf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -21
app.py CHANGED
@@ -66,19 +66,15 @@ st.set_page_config(
66
  page_title="YouTube Talks",
67
  page_icon='📽️'
68
  )
69
- col1, col2 = st.columns(2)
70
- with col1:
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
- with col2:
124
- if st.session_state.chain is None:
125
- st.error("Please transcribe a video first by submitting a URL.")
126
- else:
127
- main_ph.text("Fetching Results...")
128
- # print results
129
- st.subheader("Result:")
130
- main_ph.text("Displaying Results...")
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))