Skip to content
← Back to activity

Immutable solution version

AttributeError: 'InferenceClient' object has no attribute 'post' on HuggingfaceCustomEmbedder

Version 2

Complete solution

Shows how to fix attributeError: 'InferenceClient' object has no attribute 'post' on HuggingfaceCustomEmbedder. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For "AttributeError: 'InferenceClient' object has no attribute 'post'": install dependencies from agno-ai. Set up a valid Hugging Face API token and MongoDB URI.

AttributeError: 'InferenceClient' object has no attribute 'post'

Steps

  1. Issue agno-agi/agno#3331 (closed, 20 comments): ### Description When attempting to initialize and use HuggingfaceCustomEmbedder, an AttributeError is raised: AttributeError: 'InferenceClient' object has no attribute 'post' This error suggests that HuggingfaceCustomEmbedder attempts to call a .post() method on an instance of InferenceClient, which does not exist in the current version of the huggingface_hub package. ### Steps to Reproduce 1. Install dependencies from agno-ai. 2. Set up a valid Hugging Face API token and MongoDB URI. 3. Use the following code to initialize the embedder and vector DB: ``` embedder =...
  2. [kausmeows (commenter)]: This one is fixed in Agno itself, so first update to the latest agno release (pip install -U agno). The maintainer confirmed the InferenceClient.post AttributeError no longer happens on the current version. Note the remaining error in the thread came from someone using langchain's HuggingFaceHub, not Agno, so if you mix libraries check which one is actually raising.
  3. This comes from one real issue thread (https://github.com/agno-agi/agno/issues/3331); it is the verified fix or approach from that thread, not a general manual. Check your version of Agno first , maintainers often fix the underlying bug in a later release, and the thread may predate it.

Expected: The maintainer confirmed the InferenceClient.post AttributeError no longer happens on the current version.

When to use

You are seeing this: The maintainer confirmed the InferenceClient.post AttributeError no longer happens on the current version. Use this skill when you run into "AttributeError: 'InferenceClient' object has no attribute 'post' on HuggingfaceCustomEmbedder".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

Install dependencies from agno-ai.

Edge cases

  • Note the remaining error in the thread came from someone using langchain's HuggingFaceHub, not Agno, so if you mix libraries check which one is actually raising.

Sources

  • https://github.com/agno-agi/agno/issues/3331

Evidence

Issue gh:agno-agi/agno#3331 asked: Issue agno-agi/agno#3331 (closed, 20 comments): ### Description When attempting to initialize and use HuggingfaceCustomEmbedder, an AttributeError is raised: AttributeError: 'InferenceClient' object has no attribute 'post' This error suggests that HuggingfaceCustomEmbedder attempts to call a .post() method on an instance of InferenceClient, which does not exist in the current version of the huggingface_hub package. ### Steps to Reproduce 1. Install dependencies from agno-ai. 2. Set up a valid Hugging Face API token and MongoDB URI. 3. Use the following code to initialize the embedder and vector DB: ``` embedder =... The verified answer from the thread: [kausmeows (commenter)]: This one is fixed in Agno itself, so first update to the latest agno release (pip install -U agno). The maintainer confirmed the InferenceClient.post AttributeError no longer happens on the current version. Note the remaining error in the thread came from someone using langchain's HuggingFaceHub, not Agno, so if you mix libraries check which one is actually raising. Source: https://github.com/agno-agi/agno/issues/3331

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_YDoM8PPWQC6Bfa40dO6HZw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">AttributeError: &#39;InferenceClient&#39; object has no attribute &#39;post&#39; on HuggingfaceCustomEmbedder <span>— Vectle</span></a>

AttributeError: 'InferenceClient' object has no attribute 'post' on HuggingfaceCustomEmbedder | Vectle