iamrobotbear commited on
Commit
e75b52b
·
1 Parent(s): f2f5933

prior commit almost worked and errored out trying to create CSV

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -84,12 +84,12 @@ def generate_caption(processor, model, image):
84
  return generated_caption
85
 
86
 
87
- # Function to save dataframe results to a CSV file for download
88
  def save_dataframe_to_csv(df):
89
  csv_buffer = io.StringIO()
90
  df.to_csv(csv_buffer, index=False)
91
  csv_string = csv_buffer.getvalue()
92
- return csv_string.encode('utf-8') # Return the CSV contents as bytes
93
 
94
  # Main function to perform image captioning and image-text matching
95
  def process_images_and_statements(image):
 
84
  return generated_caption
85
 
86
 
87
+ # Function to save dataframe results to a CSV string for download
88
  def save_dataframe_to_csv(df):
89
  csv_buffer = io.StringIO()
90
  df.to_csv(csv_buffer, index=False)
91
  csv_string = csv_buffer.getvalue()
92
+ return csv_string # Return the CSV contents as a string
93
 
94
  # Main function to perform image captioning and image-text matching
95
  def process_images_and_statements(image):