Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
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
|
79 |
-
|
80 |
-
|
81 |
-
|
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
|