From 7bc826276017e54e83c15525cf2ec38785b302b6 Mon Sep 17 00:00:00 2001 From: huangjintao Date: Sat, 21 Oct 2023 08:00:51 +0000 Subject: [PATCH] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 722d26e..816758b 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,7 @@ from modelscope import Model, AutoTokenizer model = Model.from_pretrained("ZhipuAI/agentlm-13b", revision='master', device_map='auto', torch_dtype=torch.float16) tokenizer = AutoTokenizer.from_pretrained("ZhipuAI/agentlm-13b", revision='master') -prompt = """ -[INST] <> +prompt = """[INST] <> You are a helpful, respectful and honest assistant. <> @@ -40,7 +39,7 @@ There's a llama in my garden 😱 What should I do? [/INST]""" inputs = tokenizer(prompt, return_tensors="pt") # Generate -generate_ids = model.generate(inputs.input_ids.to(model.device), max_length=30) +generate_ids = model.generate(inputs.input_ids.to(model.device), max_new_tokens=512) print(tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]) ```