Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -77,14 +77,15 @@ def process_zip_files(zip_file_paths):
|
|
77 |
return csv_file_path
|
78 |
|
79 |
def gr_process(zip_files, image_files):
|
80 |
-
if zip_files:
|
|
|
|
|
81 |
zip_file_paths = [zip_file.name for zip_file in zip_files]
|
82 |
return process_zip_files(zip_file_paths)
|
83 |
elif image_files:
|
84 |
image_file_paths = [image_file.name for image_file in image_files]
|
85 |
return process_images(image_file_paths)
|
86 |
-
|
87 |
-
return None
|
88 |
def combine_csv_files(file1, file2, output_file='combined_captions.csv'):
|
89 |
with open(output_file, mode='w', newline='') as outfile:
|
90 |
writer = csv.writer(outfile)
|
|
|
77 |
return csv_file_path
|
78 |
|
79 |
def gr_process(zip_files, image_files):
|
80 |
+
if not zip_files and not image_files:
|
81 |
+
raise ValueError("At least one of zip_files or image_files must be provided.")
|
82 |
+
elif zip_files:
|
83 |
zip_file_paths = [zip_file.name for zip_file in zip_files]
|
84 |
return process_zip_files(zip_file_paths)
|
85 |
elif image_files:
|
86 |
image_file_paths = [image_file.name for image_file in image_files]
|
87 |
return process_images(image_file_paths)
|
88 |
+
|
|
|
89 |
def combine_csv_files(file1, file2, output_file='combined_captions.csv'):
|
90 |
with open(output_file, mode='w', newline='') as outfile:
|
91 |
writer = csv.writer(outfile)
|