Joshua Lochner commited on
Commit
8326048
1 Parent(s): bfb080b

Show message if predictions returned, but all ignored due to filters/settings

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -213,6 +213,10 @@ def main():
213
  st.write(f"**Confidence:** {confidence:.2f}%")
214
  st.write(f'**Text:** "{text}"')
215
 
 
 
 
 
216
  json_data = quote(json.dumps(submit_segments))
217
  link = f'[Submit Segments](https://www.youtube.com/watch?v={video_id}#segments={json_data})'
218
  st.markdown(link, unsafe_allow_html=True)
 
213
  st.write(f"**Confidence:** {confidence:.2f}%")
214
  st.write(f'**Text:** "{text}"')
215
 
216
+ if len(submit_segments) == 0:
217
+ st.success(f'No segments found! ({len(predictions)} ignored due to filters/settings)')
218
+ return
219
+
220
  json_data = quote(json.dumps(submit_segments))
221
  link = f'[Submit Segments](https://www.youtube.com/watch?v={video_id}#segments={json_data})'
222
  st.markdown(link, unsafe_allow_html=True)