"...git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "90bede2bb64161be8735d09d7df5ae6fcdc3b767"
Commit 18a879f4 authored by Lysandre's avatar Lysandre
Browse files

fix #2180

parent d8034092
...@@ -247,7 +247,11 @@ def main(): ...@@ -247,7 +247,11 @@ def main():
out = out[:, len(context_tokens):].tolist() out = out[:, len(context_tokens):].tolist()
for o in out: for o in out:
text = tokenizer.decode(o, clean_up_tokenization_spaces=True) text = tokenizer.decode(o, clean_up_tokenization_spaces=True)
text = text[: text.find(args.stop_token) if args.stop_token else None] if args.stop_token:
index = text.find(args.stop_token)
if index == -1:
index = None
text = text[:index]
print(text) print(text)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment