bcci commited on
Commit
4ed6221
·
verified ·
1 Parent(s): 435cc84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -94,16 +94,17 @@ def custom_split_text(text: str) -> list:
94
  candidate_end = len(words)
95
  chunk_words = words[start:candidate_end]
96
  split_index = None
97
- for i in range(len(chunk_words) - 1):
98
- if '.' in chunk_words[i]:
99
- split_index = i
100
- break
101
- if split_index is not None:
102
- candidate_end = start + split_index + 1
103
- chunk_words = words[start:candidate_end]
104
  chunks.append(" ".join(chunk_words))
105
  start = candidate_end
106
- chunk_size += 2
 
107
  return chunks
108
 
109
 
 
94
  candidate_end = len(words)
95
  chunk_words = words[start:candidate_end]
96
  split_index = None
97
+ # for i in range(len(chunk_words) - 1):
98
+ # if '.' in chunk_words[i]:
99
+ # split_index = i
100
+ # break
101
+ # if split_index is not None:
102
+ # candidate_end = start + split_index + 1
103
+ # chunk_words = words[start:candidate_end]
104
  chunks.append(" ".join(chunk_words))
105
  start = candidate_end
106
+ if chunk_size < 100:
107
+ chunk_size += 2
108
  return chunks
109
 
110