Update README.md
Browse files
README.md
CHANGED
@@ -41,6 +41,6 @@ model = AutoModelForCausalLM.from_pretrained(checkpoint).half().to(device)
|
|
41 |
instruction = "Write a function to scrape hacker news."
|
42 |
prompt = f"Below is an instruction that describes a task.\n Write a response that appropriately completes the request.\n\n ### Instruction:\n{instruction}\n\n### Response:"
|
43 |
inputs = tokenizer(prompt, return_tensors="pt").to(device)
|
44 |
-
outputs = model.generate(**inputs,temperature=0.3,do_sample=True)
|
45 |
-
print(tokenizer.decode(outputs[0],skip_special_tokens=True
|
46 |
```
|
|
|
41 |
instruction = "Write a function to scrape hacker news."
|
42 |
prompt = f"Below is an instruction that describes a task.\n Write a response that appropriately completes the request.\n\n ### Instruction:\n{instruction}\n\n### Response:"
|
43 |
inputs = tokenizer(prompt, return_tensors="pt").to(device)
|
44 |
+
outputs = model.generate(**inputs,temperature=0.3,do_sample=True,max_new_tokens=256)
|
45 |
+
print(tokenizer.decode(outputs[0],skip_special_tokens=True))
|
46 |
```
|