adrienbrdne commited on
Commit
21968dc
·
verified ·
1 Parent(s): 6ee8148

Update scoring/specificity.py

Browse files
Files changed (1) hide show
  1. scoring/specificity.py +8 -2
scoring/specificity.py CHANGED
@@ -93,6 +93,8 @@ def predict_batch(items: ProblematicList):
93
 
94
  try:
95
  results = []
 
 
96
 
97
  # Batch processing
98
  batch_size = 8
@@ -119,7 +121,11 @@ def predict_batch(items: ProblematicList):
119
  )
120
  )
121
 
122
- return results
123
 
 
 
 
124
  except Exception as e:
125
- print(f"Error during prediction: {str(e)}")
 
 
93
 
94
  try:
95
  results = []
96
+ if not items.problematics:
97
+ return []
98
 
99
  # Batch processing
100
  batch_size = 8
 
121
  )
122
  )
123
 
124
+ return results
125
 
126
+ except AttributeError as ae:
127
+ print(f"AttributeError during prediction in predict_batch (likely wrong input type): {str(ae)}")
128
+ return []
129
  except Exception as e:
130
+ print(f"Generic error during prediction in predict_batch: {str(e)}")
131
+ return []