awacke1 commited on
Commit
1d6759c
1 Parent(s): 7124b66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -1141,15 +1141,18 @@ def display_images_and_wikipedia_summaries(num_columns=4):
1141
 
1142
  for image_file in image_files_sorted:
1143
  with cols[col_index % num_columns]: # Cycle through columns based on num_columns
1144
- image = Image.open(image_file)
1145
- st.image(image, caption=image_file, use_column_width=True)
1146
- k = image_file.split('.')[0] # Assumes keyword is the file name without extension
1147
- display_glossary_entity(k)
1148
-
1149
- # Add text input for image file
1150
- image_text_input = st.text_input(f"Image Prompt for {image_file}", key=f"image_prompt_{image_file}")
1151
- if image_text_input:
1152
- process_image(image_file, image_text_input)
 
 
 
1153
 
1154
  col_index += 1 # Increment to move to the next column in the next iteration
1155
 
 
1141
 
1142
  for image_file in image_files_sorted:
1143
  with cols[col_index % num_columns]: # Cycle through columns based on num_columns
1144
+ try:
1145
+ image = Image.open(image_file)
1146
+ st.image(image, caption=image_file, use_column_width=True)
1147
+ k = image_file.split('.')[0] # Assumes keyword is the file name without extension
1148
+ display_glossary_entity(k)
1149
+
1150
+ # Add text input for image file
1151
+ image_text_input = st.text_input(f"Image Prompt for {image_file}", key=f"image_prompt_{image_file}")
1152
+ if image_text_input:
1153
+ process_image(image_file, image_text_input)
1154
+ except:
1155
+ errored = True
1156
 
1157
  col_index += 1 # Increment to move to the next column in the next iteration
1158