Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -97,7 +97,7 @@ def generate_answer(question, context, ground, do_pretrained):
|
|
97 |
).input_ids
|
98 |
|
99 |
# Decode the context back
|
100 |
-
decoded_context = tokenizer.decode(input_ids, skip_special_tokens=True)[len(f"question: {question} context: "):]
|
101 |
|
102 |
# Generate the answer
|
103 |
with torch.no_grad():
|
|
|
97 |
).input_ids
|
98 |
|
99 |
# Decode the context back
|
100 |
+
decoded_context = tokenizer.decode(input_ids[0], skip_special_tokens=True)[len(f"question: {question} context: "):]
|
101 |
|
102 |
# Generate the answer
|
103 |
with torch.no_grad():
|