Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -95,6 +95,11 @@ def combine_csv_files(file1, file2, output_file='combined_captions.csv'):
|
|
| 95 |
|
| 96 |
return output_file
|
| 97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
css = '''
|
| 99 |
h1#title {
|
| 100 |
text-align: center;
|
|
@@ -139,12 +144,9 @@ with demo:
|
|
| 139 |
combine_files_btn = gr.Button("Combine CSV Files")
|
| 140 |
combined_file = gr.File(label="Download Combined Captions")
|
| 141 |
|
| 142 |
-
|
| 143 |
-
# zip_files.extend(new_zip_files)
|
| 144 |
-
# image_files.extend(new_image_files)
|
| 145 |
-
# return zip_files, image_files
|
| 146 |
|
| 147 |
-
|
| 148 |
generate_zip_captions_btn.click(fn=gr_process, inputs=zip_files, outputs=output_zip_file)
|
| 149 |
generate_image_captions_btn.click(fn=gr_process, inputs=image_files, outputs=output_image_file)
|
| 150 |
combine_files_btn.click(fn=combine_csv_files, inputs=[output_zip_file, output_image_file], outputs=combined_file)
|
|
|
|
| 95 |
|
| 96 |
return output_file
|
| 97 |
|
| 98 |
+
def add_files(zip_files, image_files, new_zip_files, new_image_files):
|
| 99 |
+
zip_files += new_zip_files
|
| 100 |
+
image_files += new_image_files
|
| 101 |
+
return zip_files, image_files
|
| 102 |
+
|
| 103 |
css = '''
|
| 104 |
h1#title {
|
| 105 |
text-align: center;
|
|
|
|
| 144 |
combine_files_btn = gr.Button("Combine CSV Files")
|
| 145 |
combined_file = gr.File(label="Download Combined Captions")
|
| 146 |
|
| 147 |
+
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
+
add_files_btn.click(add_files, inputs=[zip_files, image_files, new_zip_files, new_image_files], outputs=[zip_files, image_files])
|
| 150 |
generate_zip_captions_btn.click(fn=gr_process, inputs=zip_files, outputs=output_zip_file)
|
| 151 |
generate_image_captions_btn.click(fn=gr_process, inputs=image_files, outputs=output_image_file)
|
| 152 |
combine_files_btn.click(fn=combine_csv_files, inputs=[output_zip_file, output_image_file], outputs=combined_file)
|