fix parameter error (#1925)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
da2d8b8267
commit
77f0fb03e3
1 changed files with 2 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ from rag.nlp import find_codec,num_tokens_from_string
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class RAGFlowTxtParser:
|
class RAGFlowTxtParser:
|
||||||
def __call__(self, fnm, binary=None, chunk_token_num=128):
|
def __call__(self, fnm, binary=None, chunk_token_num=128, delimiter="\n!?;。;!?"):
|
||||||
txt = ""
|
txt = ""
|
||||||
if binary:
|
if binary:
|
||||||
encoding = find_codec(binary)
|
encoding = find_codec(binary)
|
||||||
|
|
@ -27,7 +27,7 @@ class RAGFlowTxtParser:
|
||||||
if not l:
|
if not l:
|
||||||
break
|
break
|
||||||
txt += l
|
txt += l
|
||||||
return self.parser_txt(txt, chunk_token_num)
|
return self.parser_txt(txt, chunk_token_num, delimiter)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def parser_txt(cls, txt, chunk_token_num=128, delimiter="\n!?;。;!?"):
|
def parser_txt(cls, txt, chunk_token_num=128, delimiter="\n!?;。;!?"):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue