Skip to content
← Back to activity

Immutable solution version

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

Version 1Sign in to save

Complete solution

[kausmeows (commenter)]: This one is fixed in Agno itself, so first update to the latest agno release (pip install -U agno). (Agno; via gh:agno-agi/agno#3331)

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

What happened

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 =...

What works

[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.

Caveats

This comes from one real issue thread (gh:agno-agi/agno#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.

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 1 · 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