iamrobotbear commited on
Commit
dbd7efa
·
1 Parent(s): 8b69d1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -72,12 +72,13 @@ def save_dataframe_to_csv(df):
72
  # Return the file path (no need to reopen the file with "rb" mode)
73
  return temp_file_path
74
 
 
75
  # Main function to perform image captioning and image-text matching
76
  def process_images_and_statements(image, file):
77
  logging.info('Starting process_images_and_statements')
78
 
79
- # Extract the filename from the file object
80
- filename = file.name
81
 
82
  # Generate image caption for the uploaded image using git-large-r-textcaps
83
  caption = generate_caption(git_processor_large_textcaps, git_model_large_textcaps, image)
@@ -137,4 +138,4 @@ iface = gr.Interface(
137
  )
138
 
139
  # Launch the Gradio interface
140
- iface.launch()
 
72
  # Return the file path (no need to reopen the file with "rb" mode)
73
  return temp_file_path
74
 
75
+
76
  # Main function to perform image captioning and image-text matching
77
  def process_images_and_statements(image, file):
78
  logging.info('Starting process_images_and_statements')
79
 
80
+ # Extract the filename from the file object if it exists
81
+ filename = file.name if file else 'Unknown Filename'
82
 
83
  # Generate image caption for the uploaded image using git-large-r-textcaps
84
  caption = generate_caption(git_processor_large_textcaps, git_model_large_textcaps, image)
 
138
  )
139
 
140
  # Launch the Gradio interface
141
+ iface.launch()