mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix(vector): 修复 source_type 判断类型问题
- 将 source_type 转换为字符串后再与枚举值比较 - 避免了类型不匹配导致的判断错误 - 确保了数据分块功能的正常运行
This commit is contained in:
parent
fcd258d05c
commit
d636d6ea7a
|
|
@ -21,7 +21,7 @@ lock = threading.Lock()
|
|||
|
||||
|
||||
def chunk_data(data: Dict):
|
||||
if str(data.get('source_type')) == SourceType.PARAGRAPH.value:
|
||||
if str(data.get('source_type')) == str(SourceType.PARAGRAPH.value):
|
||||
text = data.get('text')
|
||||
chunk_list = text_to_chunk(text)
|
||||
return [{**data, 'text': chunk} for chunk in chunk_list]
|
||||
|
|
|
|||
Loading…
Reference in New Issue