quantumiracle-git commited on
Commit
041ca86
·
1 Parent(s): 1220a81

Update hfserver.py

Browse files
Files changed (1) hide show
  1. hfserver.py +9 -9
hfserver.py CHANGED
@@ -501,15 +501,15 @@ class HuggingFaceDatasetJSONSaver(FlaggingCallback):
501
  for component, sample in zip(self.components, flag_data):
502
  headers.append(component.label)
503
 
504
- # try:
505
- filepath = component.save_flagged(
506
- folder_name, component.label, sample, None
507
- )
508
- # except Exception:
509
- # # Could not parse 'sample' (mostly) because it was None and `component.save_flagged`
510
- # # does not handle None cases.
511
- # # for example: Label (line 3109 of components.py raises an error if data is None)
512
- # filepath = None
513
 
514
  if isinstance(component, tuple(file_preview_types)):
515
  headers.append(str(component.label) + " file")
 
501
  for component, sample in zip(self.components, flag_data):
502
  headers.append(component.label)
503
 
504
+ try:
505
+ filepath = component.save_flagged(
506
+ folder_name, component.label, sample, None
507
+ )
508
+ except Exception:
509
+ # Could not parse 'sample' (mostly) because it was None and `component.save_flagged`
510
+ # does not handle None cases.
511
+ # for example: Label (line 3109 of components.py raises an error if data is None)
512
+ filepath = None
513
 
514
  if isinstance(component, tuple(file_preview_types)):
515
  headers.append(str(component.label) + " file")