File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -545,12 +545,17 @@ def load_one_doc(
545545 )
546546 assert docs [i ].metadata ["all_hash" ], f"Empty all_hash for document: { docs [i ]} "
547547
548- total_reading_length = sum ([float (d .metadata ["doc_reading_time" ]) for d in docs ])
549- assert total_reading_length > 0.1 , (
550- f"Failing doc: total reading length is { total_reading_length :.3f} "
551- "min which is suspiciously low. Filetype {filetype} with kwargs "
552- f"'{ kwargs } '"
553- )
548+ try :
549+ total_reading_length = sum ([float (d .metadata ["doc_reading_time" ]) for d in docs ])
550+ except Exception :
551+ total_reading_length = None
552+ pass
553+ if total_reding_length is not None :
554+ assert total_reading_length > 0.1 , (
555+ f"Failing doc: total reading length is { total_reading_length :.3f} "
556+ "min which is suspiciously low. Filetype {filetype} with kwargs "
557+ f"'{ kwargs } '"
558+ )
554559
555560 assert docs , "empty list of loaded documents!"
556561 return docs
You can’t perform that action at this time.
0 commit comments