Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
pass-lin authored Oct 25, 2022
1 parent 95d9815 commit 45ebd13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sznlp/cache_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ def writer(

try:
result.extend(
self.tokenizer.decode(y).replace(self.skip_token, "\n") for y in ys
self.tokenizer.decode(y) for y in ys
)

except Exception:
# 如果用的是SpTokenizer需要手动转成int的列表才能用
for y in ys:
t = [int(a) for a in y]
result.append(self.tokenizer.decode(t).replace(self.skip_token, "\n"))
result.append(self.tokenizer.decode(t))
print("\n")
return result

0 comments on commit 45ebd13

Please sign in to comment.