Spaces:
Build error
Build error
Commit
·
e75b52b
1
Parent(s):
f2f5933
prior commit almost worked and errored out trying to create CSV
Browse files
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
|
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
|
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):
|