fix: handle KeyError when accessing rules in CleanProcessor.clean (#10258)

This commit is contained in:
pinsily 2024-11-05 14:47:15 +08:00 committed by GitHub
parent 233bffdb7d
commit 5f21d13572
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -598,7 +598,7 @@ class IndexingRunner:
rules = DatasetProcessRule.AUTOMATIC_RULES
else:
rules = json.loads(processing_rule.rules) if processing_rule.rules else {}
document_text = CleanProcessor.clean(text, rules)
document_text = CleanProcessor.clean(text, {"rules": rules})
return document_text