update README.md
Browse files
README.md
CHANGED
|
@@ -34,7 +34,7 @@ messages = [
|
|
| 34 |
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors='pt')
|
| 35 |
if torch.cuda.is_available():
|
| 36 |
input_ids = input_ids.to('cuda')
|
| 37 |
-
pred = model.generate(
|
| 38 |
print(tokenizer.decode(pred[0][input_ids.shape[1]:], skip_special_tokens=True))
|
| 39 |
```
|
| 40 |
|
|
|
|
| 34 |
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors='pt')
|
| 35 |
if torch.cuda.is_available():
|
| 36 |
input_ids = input_ids.to('cuda')
|
| 37 |
+
pred = model.generate(input_ids, max_new_tokens=512, repetition_penalty=1.06, eos_token_id=tokenizer.eos_token_id)
|
| 38 |
print(tokenizer.decode(pred[0][input_ids.shape[1]:], skip_special_tokens=True))
|
| 39 |
```
|
| 40 |
|