Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ bench = Benchmark(model, tokenizer)
|
|
| 23 |
|
| 24 |
def get_prediction(text):
|
| 25 |
encoding = tokenizer(text, return_tensors="pt", padding="max_length", truncation=True, max_length=200)
|
| 26 |
-
encoding = {k: v.to(
|
| 27 |
|
| 28 |
with torch.no_grad():
|
| 29 |
outputs = model(**encoding)
|
|
|
|
| 23 |
|
| 24 |
def get_prediction(text):
|
| 25 |
encoding = tokenizer(text, return_tensors="pt", padding="max_length", truncation=True, max_length=200)
|
| 26 |
+
encoding = {k: v.to(model.device) for k, v in encoding.items()}
|
| 27 |
|
| 28 |
with torch.no_grad():
|
| 29 |
outputs = model(**encoding)
|