BlinkDL commited on
Commit
85b3476
1 Parent(s): 079173b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -75,11 +75,11 @@ def evaluate(
75
  all_tokens += [token]
76
  for xxx in occurrence:
77
  occurrence[xxx] *= 0.996
78
- if token not in occurrence:
79
- occurrence[token] = 1
80
- else:
81
- occurrence[token] += 1
82
-
83
  tmp = pipeline.decode(all_tokens[out_last:])
84
  if '\ufffd' not in tmp:
85
  out_str += tmp
 
75
  all_tokens += [token]
76
  for xxx in occurrence:
77
  occurrence[xxx] *= 0.996
78
+ if pipeline.decode([token]) not in ' \r\n\t,.;?!"\':0123456789+-*/=#@$%^&_`~|<>\\()[]{},。;“”:?!()【】':
79
+ if token not in occurrence:
80
+ occurrence[token] = 1
81
+ else:
82
+ occurrence[token] += 1
83
  tmp = pipeline.decode(all_tokens[out_last:])
84
  if '\ufffd' not in tmp:
85
  out_str += tmp