NourFakih commited on
Commit
ca2369e
·
verified ·
1 Parent(s): 35078d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -63,13 +63,10 @@ def process_zip_files(zip_file_paths):
63
  return captions
64
 
65
  def save_captions_to_csv(captions, csv_file_path='image_captions.csv'):
66
- if captions:
67
- with open(csv_file_path, mode='w', newline='') as file:
68
- writer = csv.writer(file)
69
- writer.writerow(['Image Name', 'Caption'])
70
- writer.writerows(captions)
71
- else:
72
- print("No captions to save.")
73
  return csv_file_path
74
 
75
  def gr_process(zip_files, image_files):
 
63
  return captions
64
 
65
  def save_captions_to_csv(captions, csv_file_path='image_captions.csv'):
66
+ with open(csv_file_path, mode='w', newline='') as file:
67
+ writer = csv.writer(file)
68
+ writer.writerow(['Image Name', 'Caption'])
69
+ writer.writerows(captions)
 
 
 
70
  return csv_file_path
71
 
72
  def gr_process(zip_files, image_files):