mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 分段不支持类型的文件报错
This commit is contained in:
parent
c0d0f53baa
commit
8b31fd6b36
|
|
@ -29,7 +29,8 @@ class TextSplitHandle(BaseSplitHandle):
|
|||
if file_name.endswith(".md") or file_name.endswith('.txt'):
|
||||
return True
|
||||
result = detect(buffer)
|
||||
if result['encoding'] != 'ascii' and result['confidence'] > 0.5:
|
||||
if result['encoding'] is not None and result['confidence'] is not None and result['encoding'] != 'ascii' and \
|
||||
result['confidence'] > 0.5:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue