mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Fixing factually incorrect example (#2810)
### https://github.com/hwchase17/langchain/issues/2802 It appears that Google's Flan model may not perform as well as other models, I used a simple example to get factually correct answer.
This commit is contained in:
parent
a6f767ae7a
commit
2a89dc8c1c
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 3,
|
"execution_count": 41,
|
||||||
"id": "3acf0069",
|
"id": "3acf0069",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -20,7 +20,7 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"The Seattle Seahawks won the Super Bowl in 2010. Justin Beiber was born in 2010. The final answer: Seattle Seahawks.\n"
|
"The FIFA World Cup is a football tournament that is played every 4 years. The year 1994 was the 44th FIFA World Cup. The final answer: Brazil.\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -33,7 +33,7 @@
|
|||||||
"prompt = PromptTemplate(template=template, input_variables=[\"question\"])\n",
|
"prompt = PromptTemplate(template=template, input_variables=[\"question\"])\n",
|
||||||
"llm_chain = LLMChain(prompt=prompt, llm=HuggingFaceHub(repo_id=\"google/flan-t5-xl\", model_kwargs={\"temperature\":0, \"max_length\":64}))\n",
|
"llm_chain = LLMChain(prompt=prompt, llm=HuggingFaceHub(repo_id=\"google/flan-t5-xl\", model_kwargs={\"temperature\":0, \"max_length\":64}))\n",
|
||||||
"\n",
|
"\n",
|
||||||
"question = \"What NFL team won the Super Bowl in the year Justin Beiber was born?\"\n",
|
"question = \"Who won the FIFA World Cup in the year 1994? \"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"print(llm_chain.run(question))"
|
"print(llm_chain.run(question))"
|
||||||
]
|
]
|
||||||
@ -41,7 +41,7 @@
|
|||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "ae4559c7",
|
"id": "843a3837",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": []
|
||||||
@ -63,7 +63,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.10.9"
|
"version": "3.8.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
Loading…
Reference in New Issue
Block a user