Sfoglia il codice sorgente

use sub to operate all (#475)

tags/0.3.7
crazywoola 2 anni fa
parent
commit
998f819b04
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4
    4
      api/core/indexing_runner.py

+ 4
- 4
api/core/indexing_runner.py Vedi File

@@ -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…
Annulla
Salva