From 711b8f1e527c59e9905bb9c485a13b5849f1eb68 Mon Sep 17 00:00:00 2001 From: Mohammad Mohtashim <45242107+keenborder786@users.noreply.github.com> Date: Tue, 21 May 2024 01:23:28 +0400 Subject: [PATCH] docs: HuggingFace Endpoint Documentation Fixed (#21914) Fixed Documentation for HuggingFaceEndpoint as per the issue #21903 --------- Co-authored-by: keenborder786 Co-authored-by: Bagatur --- docs/docs/integrations/llms/huggingface_endpoint.ipynb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/docs/integrations/llms/huggingface_endpoint.ipynb b/docs/docs/integrations/llms/huggingface_endpoint.ipynb index fbb5f8ee9f0..dc177d908b8 100644 --- a/docs/docs/integrations/llms/huggingface_endpoint.ipynb +++ b/docs/docs/integrations/llms/huggingface_endpoint.ipynb @@ -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}))" ] }, {