"vscode:/vscode.git/clone" did not exist on "0e19a4c2d6402eaf9a8bd8faa5fbaf40e329c396"
Commit 18a879f4 authored by Lysandre's avatar Lysandre
Browse files

fix #2180

parent d8034092
......@@ -247,7 +247,11 @@ def main():
out = out[:, len(context_tokens):].tolist()
for o in out:
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)
......
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