File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -500,10 +500,28 @@ def batch_load_doc(
500500 st [s ] += 1
501501 else :
502502 no_st += 1
503+
504+ # Count failures per source tag
505+ st_failed = {t : 0 for t in asked_source_tags }
506+ for failed_doc in missing_docargs :
507+ if "source_tag" in failed_doc :
508+ tag = failed_doc ["source_tag" ]
509+ if tag in st_failed :
510+ st_failed [tag ] += 1
511+
503512 should_crash = False
504513 logger .warning ("Found the following source_tag after loading all documents:" )
505514 for n , s in st .items ():
506- logger .warning (f"- { s } : { n } " )
515+ # n is the tag name, s is the successful count
516+ n_failed = st_failed .get (n , 0 )
517+ if n_failed > 0 :
518+ total = s + n_failed
519+ success_rate = (s / total * 100 ) if total > 0 else 0
520+ logger .warning (
521+ f"- { s } : { n } ({ n_failed } failed, { success_rate :.1f} % success rate)"
522+ )
523+ else :
524+ logger .warning (f"- { s } : { n } " )
507525 if n == 0 :
508526 should_crash = True
509527 if extra :
You can’t perform that action at this time.
0 commit comments