Open minmin-intel opened 3 months ago
I am experiencing the same issue.
I'm getting:
HfHubHTTPError: 422 Client Error: Unprocessable Entity for url: https://yna78eduyn1wumb2.us-east-1.aws.endpoints.huggingface.cloud/v1/chat/completions (Request ID: lIPtPv)
using:
from langchain_core.utils.function_calling import convert_to_openai_tool
dict_schema = convert_to_openai_tool(ArticleAnalysis)
output_msg = chat_model.bind(max_tokens=8192, temperature=0.0).with_structured_output(dict_schema).invoke(chat_sequence)
chat_sequence.append(output_msg)
md_text = output_msg.content
display_markdown(md_text, raw=True)
display_markdown("**Finish Reason**: " + output_msg.response_metadata["finish_reason"], raw=True)
pprint(output_msg.response_metadata)
@Jofthomas could this be linked to this issue? Not sure if the base_url
argument is available in the langchain wrapper
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
No response
Description
Using ChatHuggingFace with llm being HuggingFaceEndpoint got 422 error "Unprocessable entity" from huggingface-hub Inference client post function, when using the latest versions of langchain and huggigface-hub 0.24.3. Downgrading to the following version, I got the code to run.
The working versions of packages huggingface_hub==0.24.0 langchain==0.2.9 langchain-core==0.2.21 langchain-huggingface==0.0.3 langchain_community==0.2.7
System Info
The following versions are what caused problems langchain-community==0.0.38 langchain-core==0.2.19 langchain-huggingface==0.0.3 langchain-openai==0.1.16 huggingface_hub==0.24.3