Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_dir)
|
|
| 10 |
model = AutoModelForSequenceClassification.from_pretrained(model_dir, config=config)
|
| 11 |
|
| 12 |
def inference(input_text):
|
| 13 |
-
inputs = tokenizer.batch_encode_plus([input_text], return_tensors="pt",
|
| 14 |
|
| 15 |
with torch.no_grad():
|
| 16 |
logits = model(**inputs)["logits"]
|
|
|
|
| 10 |
model = AutoModelForSequenceClassification.from_pretrained(model_dir, config=config)
|
| 11 |
|
| 12 |
def inference(input_text):
|
| 13 |
+
inputs = tokenizer.batch_encode_plus([input_text], return_tensors="pt", max_length=512, truncation=True, padding="max_length")
|
| 14 |
|
| 15 |
with torch.no_grad():
|
| 16 |
logits = model(**inputs)["logits"]
|