Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -74,12 +74,19 @@ def evaluate(
|
|
74 |
break
|
75 |
all_tokens += [token]
|
76 |
for xxx in occurrence:
|
77 |
-
occurrence[xxx] *= 0.996
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
tmp = pipeline.decode(all_tokens[out_last:])
|
84 |
if '\ufffd' not in tmp:
|
85 |
out_str += tmp
|
|
|
74 |
break
|
75 |
all_tokens += [token]
|
76 |
for xxx in occurrence:
|
77 |
+
occurrence[xxx] *= 0.996
|
78 |
+
|
79 |
+
ttt = pipeline.decode([token])
|
80 |
+
www = 1
|
81 |
+
if ttt in ' \t0123456789':
|
82 |
+
www = 0
|
83 |
+
elif ttt in '\r\n,.;?!"\':+-*/=#@$%^&_`~|<>\\()[]{},。;“”:?!()【】':
|
84 |
+
www = 0.5
|
85 |
+
if token not in occurrence:
|
86 |
+
occurrence[token] = www
|
87 |
+
else:
|
88 |
+
occurrence[token] += www
|
89 |
+
|
90 |
tmp = pipeline.decode(all_tokens[out_last:])
|
91 |
if '\ufffd' not in tmp:
|
92 |
out_str += tmp
|