mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-07 12:37:27 +00:00
fix answer is not subscriptable error (#2069)
* fix answer is not subscriptable error * fix answer is not subscriptable in script
This commit is contained in:
parent
8a32d8da92
commit
0f34983f74
@ -314,7 +314,7 @@
|
||||
"\n",
|
||||
" # Print you answer\n",
|
||||
" answers = predicted_result[\"answers\"]\n",
|
||||
" print(f'Generated answer is \\'{answers[0][\"answer\"]}\\' for the question = \\'{question}\\'')"
|
||||
" print(f'Generated answer is \\'{answers[0].answer}\\' for the question = \\'{question}\\'')"
|
||||
],
|
||||
"outputs": [],
|
||||
"metadata": {
|
||||
@ -391,4 +391,4 @@
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ def tutorial7_rag_generator():
|
||||
|
||||
# Print you answer
|
||||
answers = predicted_result["answers"]
|
||||
print(f' -> Generated answer is \'{answers[0]["answer"]}\' for the question = \'{question}\'')
|
||||
print(f' -> Generated answer is \'{answers[0].answer}\' for the question = \'{question}\'')
|
||||
|
||||
# Or alternatively use the Pipeline class
|
||||
from haystack.pipelines import GenerativeQAPipeline
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user