瀏覽代碼

use sub to operate all (#475)

tags/0.3.7
crazywoola 2 年之前
父節點
當前提交
998f819b04
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. 4
    4
      api/core/indexing_runner.py

+ 4
- 4
api/core/indexing_runner.py 查看文件

@@ -346,10 +346,10 @@ class IndexingRunner:
return text_docs

def filter_string(self, text):
text = text.replace('<|', '<')
text = text.replace('|>', '>')
pattern = re.compile('[\x00-\x08\x0B\x0C\x0E-\x1F\x7F\x80-\xFF]')
return pattern.sub('', text)
text = re.sub(r'<\|', '<', text)
text = re.sub(r'\|>', '>', text)
text = re.sub(r'[\x00-\x08\x0B\x0C\x0E-\x1F\x7F\x80-\xFF]', '', text)
return text

def _get_splitter(self, processing_rule: DatasetProcessRule) -> TextSplitter:
"""

Loading…
取消
儲存