⚡️ Speed up get_word_count() by 6% in embedchain/chunkers/base_chunker.py (#1268)
This commit is contained in:
@@ -84,4 +84,4 @@ class BaseChunker(JSONSerializable):
|
||||
|
||||
@staticmethod
|
||||
def get_word_count(documents) -> int:
|
||||
return sum([len(document.split(" ")) for document in documents])
|
||||
return sum(len(document.split(" ")) for document in documents)
|
||||
|
||||
Reference in New Issue
Block a user