Word embeddings via http call: error 404

Hello,

I read this article to learn how to compute embeddings for texts: Getting Started With Embeddings

Here is the code I am running.

api_url = https://api-inference.huggingface.co/pipeline/feature-extraction/sentence-transformers/all-MiniLM-L6-v2
headers = {"Authorization": f"Bearer {api_token}"}

texts = ["How do I get a replacement Medicare card?",
        "What is the monthly premium for Medicare Part B?",
        ]
response = requests.post(api_url, headers=headers, json={"inputs": texts, "options": {"wait_for_model": True}})

Unfortunately, I always get a 404 error.

Am I missing something?

Thank everyone for helping!

J-C

1 Like

Well, most likely the code is not the problem. It seems that almost no models are available at the moment. I don’t even know which topic from discussions to share, because almost all of them now are about broken API: Inference API stopped working, But is there even a single model working here?!, Persistent DNS Resolution Errors

3 Likes