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]) ```