Getting image_flag error

#2
by meg HF staff - opened
Files changed (1) hide show
  1. app_dialogue.py +4 -2
app_dialogue.py CHANGED
@@ -257,8 +257,10 @@ def flag_dope(
257
  if isinstance(ex[0], dict):
258
  images.append(ex[0]["file"])
259
  prev_ex_is_image = True
260
-
261
- image_flag = images[0]
 
 
262
  dope_dataset_writer.flag(
263
  flag_data=[
264
  model_selector,
 
257
  if isinstance(ex[0], dict):
258
  images.append(ex[0]["file"])
259
  prev_ex_is_image = True
260
+ if len(images) > 0:
261
+ image_flag = images[0]
262
+ else:
263
+ image_flag = False
264
  dope_dataset_writer.flag(
265
  flag_data=[
266
  model_selector,