Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ def load_model():
|
|
| 10 |
return model, tokenizer
|
| 11 |
|
| 12 |
def answer_question(question, model, tokenizer):
|
| 13 |
-
inputs = tokenizer(question, return_tensors="pt", max_length=
|
| 14 |
|
| 15 |
with torch.no_grad():
|
| 16 |
outputs = model(**inputs)
|
|
|
|
| 10 |
return model, tokenizer
|
| 11 |
|
| 12 |
def answer_question(question, model, tokenizer):
|
| 13 |
+
inputs = tokenizer(question, return_tensors="pt", max_length=512, truncation=True, padding="max_length")
|
| 14 |
|
| 15 |
with torch.no_grad():
|
| 16 |
outputs = model(**inputs)
|