sujitb commited on
Commit
09a527e
1 Parent(s): 74ebc61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -288,11 +288,17 @@ if QUESTION:
288
  response = st.write_stream(response_generator(ans))
289
  if goodmatch:
290
  st.write('Resources:')
291
- st.write("["+top_2[0]['title']+"]("+top_2[0]['url']+")")
292
- #st.write(top_2[0]['url'])
293
- if top_2[0]['url']!=top_2[1]['url']:
294
- st.write("["+top_2[1]['title']+"]("+top_2[1]['url']+")")
295
- #st.write(top_2[1]['url'])
 
 
 
 
 
 
296
  else:
297
  st.write('Resources:',top_2[0]['score'], ' confidence')
298
  st.write(top_2[0]['url'])
 
288
  response = st.write_stream(response_generator(ans))
289
  if goodmatch:
290
  st.write('Resources:')
291
+ for k in range(2):
292
+ disp_title=top_2[k]['title']
293
+ disp_url= top_2[k]['url']
294
+ if 'youtube' in disp_url:
295
+ disp_title='Youtube: '+disp_title
296
+
297
+ if k>0:
298
+ if top_2[k]['url']==top_2[k-1]['url']:
299
+ break
300
+ st.write("["+disp_title+"]("+disp_url+")")
301
+
302
  else:
303
  st.write('Resources:',top_2[0]['score'], ' confidence')
304
  st.write(top_2[0]['url'])