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

Me too going with the same error
AttributeError: ‘InferenceClient’ object has no attribute ‘post’
the code snippet is shared below
from langchain import HuggingFaceHub, LLMChain
from langchain.prompts import PromptTemplate
os.environ[“HF_TOKEN”] = “my_token”

llm=HuggingFaceHub(repo_id=“mistralai/Mistral-7B-Instruct-v0.2”)

prompt = PromptTemplate(
input_variables=[“product”],
template=“What is the best name for startup of {product}?”
)

chain= LLMChain(prompt=prompt,llm=llm,verbose=True)
print(chain.run(“camera”))

2 Likes