Spaces:
Runtime error
Runtime error
Commit
·
6d9e11a
1
Parent(s):
31dcc6b
len
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ model = MBartForConditionalGeneration.from_pretrained(model_name)
|
|
9 |
def answer_question(context, question):
|
10 |
# Prepare input text
|
11 |
input_text = f"context: {context} question: {question}"
|
12 |
-
inputs = tokenizer(input_text, return_tensors="pt", max_length=
|
13 |
|
14 |
# Generate answer
|
15 |
outputs = model.generate(
|
|
|
9 |
def answer_question(context, question):
|
10 |
# Prepare input text
|
11 |
input_text = f"context: {context} question: {question}"
|
12 |
+
inputs = tokenizer(input_text, return_tensors="pt", max_length=512, truncation=False, padding="max_length")
|
13 |
|
14 |
# Generate answer
|
15 |
outputs = model.generate(
|