GETTING ERROR >> AttributeError: 'InferenceClient' object has no attribute 'post'

You’re using InferenceClient which doesn’t have a .post() method. LangChain expects HuggingFaceHub for this to work.

Swap it to:

from langchain.llms import HuggingFaceHub
llm = HuggingFaceHub(repo_id=“mistralai/Mistral-7B-Instruct-v0.2”, huggingfacehub_api_token=“your_token”)

That’ll stop the .post() error.

Solution provided by Triskel Data Deterministic AI

1 Like