awacke1 commited on
Commit
d9d228b
โ€ข
1 Parent(s): b0d34ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -571,12 +571,13 @@ image_urls = [
571
  "https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/cmCZ5RTdSx3usMm7MwwWK.png",
572
  ]
573
 
574
- selected_image_url = random.choice(image_urls)
575
- selected_image_base64 = get_image_as_base64(selected_image_url)
576
- if selected_image_base64 is not None:
577
- with st.sidebar:
578
- st.markdown(f"![image](data:image/png;base64,{selected_image_base64})")
579
- else:
 
580
  st.sidebar.write("Failed to load the image.")
581
 
582
  # Ensure the directory for storing scores exists
@@ -1387,10 +1388,12 @@ if example_input:
1387
  # Search AI
1388
  query=example_input
1389
  if query:
1390
- result = search_arxiv(query)
1391
- #search_glossary(query)
1392
- search_glossary(result)
1393
- st.markdown(' ')
 
 
1394
 
1395
  st.write("Search history:")
1396
  for example_input in session_state["search_queries"]:
 
571
  "https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/cmCZ5RTdSx3usMm7MwwWK.png",
572
  ]
573
 
574
+ try:
575
+ selected_image_url = random.choice(image_urls)
576
+ selected_image_base64 = get_image_as_base64(selected_image_url)
577
+ if selected_image_base64 is not None:
578
+ with st.sidebar:
579
+ st.markdown(f"![image](data:image/png;base64,{selected_image_base64})")
580
+ except:
581
  st.sidebar.write("Failed to load the image.")
582
 
583
  # Ensure the directory for storing scores exists
 
1388
  # Search AI
1389
  query=example_input
1390
  if query:
1391
+ try:
1392
+ result = search_arxiv(query)
1393
+ #search_glossary(query)
1394
+ search_glossary(result)
1395
+ except:
1396
+ st.markdown(' ')
1397
 
1398
  st.write("Search history:")
1399
  for example_input in session_state["search_queries"]: