awacke1 commited on
Commit
628d717
1 Parent(s): c7521e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -30
app.py CHANGED
@@ -616,41 +616,19 @@ def display_images_and_wikipedia_summaries():
616
 
617
  # Create a map for number of columns to use for each size
618
  num_columns_map = {"small": 4, "medium": 3, "large": 2}
619
- current_grid_size = 2
620
-
621
  for image_file, col_size in zip(image_files_sorted, col_sizes):
622
  if current_grid_size != num_columns_map[col_size]:
623
  cols = st.columns(num_columns_map[col_size])
624
  current_grid_size = num_columns_map[col_size]
625
  col_index = 0
626
-
627
- with cols[col_index % current_grid_size]:
628
- image = Image.open(image_file)
629
- st.image(image, caption=image_file, use_column_width=True)
630
-
631
- # Display Wikipedia and Google search links
632
- k = image_file.split('.')[0] # Assumes keyword is the file name without extension
633
-
634
- display_glossary_entity(k)
635
-
636
- #wikipedia_url = create_search_url_wikipedia(keyword)
637
- #google_url = create_search_url_google(keyword)
638
- #youtube_url = create_search_url_youtube(keyword)
639
- #bing_url = create_search_url_bing(keyword)
640
- #ai_url = create_search_url_ai(keyword)
641
- #ai_url2 = create_search_url_ai(keyword + ' ' + PromptPrefix)
642
- #ai_url3 = create_search_url_ai(keyword + ' ' + PromptPrefix2)
643
- #links_md = f"""
644
- #[Wikipedia]({wikipedia_url}) |
645
- #[Google]({google_url}) |
646
- #[YouTube]({youtube_url}) |
647
- #[Bing]({bing_url}) |
648
- #[AI]({ai_url})|
649
- #[AI Novel]({ai_url2} )|
650
- #[AI Novel App]({ai_url3})
651
- #"""
652
- #st.markdown(links_md)
653
- #col_index += 1
654
 
655
 
656
  def get_all_query_params(key):
 
616
 
617
  # Create a map for number of columns to use for each size
618
  num_columns_map = {"small": 4, "medium": 3, "large": 2}
619
+ current_grid_size = 0
 
620
  for image_file, col_size in zip(image_files_sorted, col_sizes):
621
  if current_grid_size != num_columns_map[col_size]:
622
  cols = st.columns(num_columns_map[col_size])
623
  current_grid_size = num_columns_map[col_size]
624
  col_index = 0
625
+ with cols[col_index % current_grid_size]:
626
+ image = Image.open(image_file)
627
+ st.image(image, caption=image_file, use_column_width=True)
628
+ # Display search links
629
+ k = image_file.split('.')[0] # Assumes keyword is the file name without extension
630
+ display_glossary_entity(k)
631
+ #col_index += 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
632
 
633
 
634
  def get_all_query_params(key):