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