|
|
|
@ -12,17 +12,32 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 2,
|
|
|
|
|
"execution_count": 1,
|
|
|
|
|
"id": "51a54c4d",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"\u001b[1m> Entering new chain...\u001b[0m\n",
|
|
|
|
|
"Prompt after formatting:\n",
|
|
|
|
|
"\u001b[32;1m\u001b[1;3mQuestion: What NFL team won the Super Bowl in the year Justin Beiber was born?\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Answer: Let's think step by step.\u001b[0m\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"\u001b[1m> Finished chain.\u001b[0m\n"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
|
|
|
|
"text/plain": [
|
|
|
|
|
"' The year Justin Beiber was born was 1994. In 1994, the Dallas Cowboys won the Super Bowl.'"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"execution_count": 2,
|
|
|
|
|
"execution_count": 1,
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "execute_result"
|
|
|
|
|
}
|
|
|
|
@ -34,7 +49,7 @@
|
|
|
|
|
"\n",
|
|
|
|
|
"Answer: Let's think step by step.\"\"\"\n",
|
|
|
|
|
"prompt = PromptTemplate(template=template, input_variables=[\"question\"])\n",
|
|
|
|
|
"llm_chain = LLMChain(prompt=prompt, llm=OpenAI(temperature=0))\n",
|
|
|
|
|
"llm_chain = LLMChain(prompt=prompt, llm=OpenAI(temperature=0), verbose=True)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"question = \"What NFL team won the Super Bowl in the year Justin Beiber was born?\"\n",
|
|
|
|
|
"\n",
|
|
|
|
|