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

Use below code: This will resolve and you can prompt:

repo_id=“mistralai/Mistral-7B-Instruct-v0.3”

llm = HuggingFaceEndpoint(
repo_id=repo_id,
max_new_tokens=512,
top_k=10,
top_p=0.95,
typical_p=0.95,
temperature=0.01,
repetition_penalty=1.03,
huggingfacehub_api_token=sec_key
)

print(llm.invoke("write a poem on deep learning , for children age 10 "))

1 Like