Update README.md
This commit is contained in:
@@ -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 = """
|
||||
<s>[INST] <<SYS>>
|
||||
prompt = """<s>[INST] <<SYS>>
|
||||
You are a helpful, respectful and honest assistant.
|
||||
<</SYS>>
|
||||
|
||||
@@ -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])
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user