Update README.md
#2
by
wajahatalikhan
- opened
README.md
CHANGED
|
@@ -149,14 +149,14 @@ GENERATION_CONFIG = GenerationConfig(
|
|
| 149 |
max_new_tokens=1024,
|
| 150 |
)
|
| 151 |
|
| 152 |
-
|
| 153 |
inputs.input_ids.to("cuda:0"),
|
| 154 |
GENERATION_CONFIG,
|
| 155 |
attention_mask=inputs.attention_mask.to("cuda:0"),
|
| 156 |
)
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
|
| 162 |
```
|
|
|
|
| 149 |
max_new_tokens=1024,
|
| 150 |
)
|
| 151 |
|
| 152 |
+
outputs = model.generate(
|
| 153 |
inputs.input_ids.to("cuda:0"),
|
| 154 |
GENERATION_CONFIG,
|
| 155 |
attention_mask=inputs.attention_mask.to("cuda:0"),
|
| 156 |
)
|
| 157 |
+
outputs = outputs[:, inputs.input_ids.shape[-1]:]
|
| 158 |
+
answers = processor.batch_decode(outputs, skip_special_tokens=True)
|
| 159 |
+
for ans in answers:
|
| 160 |
+
print(ans)
|
| 161 |
|
| 162 |
```
|