Merge pull request #302 from yolain/v1.2.2-beta

Fix filtering embedding carries chinese #299
This commit is contained in:
yolain
2024-08-11 12:30:18 +08:00
committed by GitHub
+1 -1
View File
@@ -80,7 +80,7 @@ def has_chinese(text):
_text = text
_text = re.sub(r'<.*?>', '', _text)
_text = re.sub(r'__.*?__', '', _text)
_text = re.sub(r'embedding:.*?(\d+)?', '', _text)
_text = re.sub(r'embedding:.*?$', '', _text)
for char in _text:
if '\u4e00' <= char <= '\u9fff':
has_cn = True