Spaces:
Sleeping
Sleeping
Commit
·
7cb92d1
1
Parent(s):
0195be0
feat: add truncation
Browse files
app.py
CHANGED
|
@@ -52,7 +52,7 @@ def classify_pairs(model, tokenizer, prompts, responses):
|
|
| 52 |
]
|
| 53 |
|
| 54 |
with torch.inference_mode():
|
| 55 |
-
input_ids = tokenizer(texts,
|
| 56 |
outputs = model(**input_ids)
|
| 57 |
|
| 58 |
return outputs
|
|
|
|
| 52 |
]
|
| 53 |
|
| 54 |
with torch.inference_mode():
|
| 55 |
+
input_ids = tokenizer(texts, truncation=True, max_length=512).to(model.device)
|
| 56 |
outputs = model(**input_ids)
|
| 57 |
|
| 58 |
return outputs
|