UNIST-Eunchan commited on
Commit
56b6b47
1 Parent(s): ac0ecce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -36,6 +36,10 @@ def infer(input_ids, max_length, temperature, top_k, top_p):
36
  def chunking(book_text):
37
  sentences = sent_tokenize(book_text)
38
  segments = []
 
 
 
 
39
  #sentences, token_lens
40
  current_segment = ""
41
  total_token_lens = 0
 
36
  def chunking(book_text):
37
  sentences = sent_tokenize(book_text)
38
  segments = []
39
+ token_lens = []
40
+
41
+ for sent_i_th in sentences:
42
+ token_lens.append(len(tokenizer.tokenize(sent_i_th)))
43
  #sentences, token_lens
44
  current_segment = ""
45
  total_token_lens = 0