docs: HuggingFace Endpoint Documentation Fixed (#21914)

Fixed Documentation for HuggingFaceEndpoint as per the issue #21903

---------

Co-authored-by: keenborder786 <mohammad.mohtashim78@gmail.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
Mohammad Mohtashim 2024-05-21 01:23:28 +04:00 committed by GitHub
parent 25d1c1c9bb
commit 711b8f1e52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -131,10 +131,13 @@
"repo_id = \"mistralai/Mistral-7B-Instruct-v0.2\"\n",
"\n",
"llm = HuggingFaceEndpoint(\n",
" repo_id=repo_id, max_length=128, temperature=0.5, token=HUGGINGFACEHUB_API_TOKEN\n",
" repo_id=repo_id,\n",
" max_length=128,\n",
" temperature=0.5,\n",
" huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,\n",
")\n",
"llm_chain = LLMChain(prompt=prompt, llm=llm)\n",
"print(llm_chain.run(question))"
"llm_chain = prompt | llm\n",
"print(llm_chain.invoke({\"question\": question}))"
]
},
{