Feature extraction with Inference API in Javascript
Hi everyone, I need to use a model for feature extraction through the Inference API in Javascript.Using the examples described inParameters, by using this code:async function query(data) {
    const response = await fetch(
        "https://api-inference.huggingface.co/models/sentence-transformers/all-mpnet-base-v2",
        {
            method: "POST",
            headers: {
                Authorization: `Bearer REDACTED_TOKEN`,
                "Content-Type": "application/json"
            },
            body: JSON.stringify(data),
        }
    );
    const result = await response.json();
    return result;
}
query({
    inputs: "Can you please let us know more details about your "
}).then((response) => {
    console.log(JSON.stringify(response, null, 2));
});I’m getting the error{
  "error": [
    "Input should be a valid dictionary or instance of SentenceSimilarityInputsCheck: received `Can you please let us know more details about your ` in `parameters`"
  ]
}Thanks in advance!
2024-10-04T11:48:04Z
Maybe the error is more troublesome than I thought. Maybe something is wrong with the model repo settings. Try another model if you can.github.com/langchain-ai/langchainjsError: SentenceSimilarityInputsCheckopened10:26AM - 02 May 23 UTCclosed12:35AM - 30 Jan 24 UTCmrcashcashthis error accrues while using HuggingFaceInferenceEmbeddings with NOT default m…odel.

error - unhandledRejection: Error: SentenceSimilarityInputsCheck expected dict not list: `__root__` in `parameters`
    at HfInference.request (file:///C:/Users/USER/Documents/GitHub/chatbot-ui/node_modules/@huggingface/inference/dist/index.mjs:425:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HfInference.featureExtraction (file:///C:/Users/USER/Documents/GitHub/chatbot-ui/node_modules/@huggingface/inference/dist/index.mjs:264:17)
    at async RetryOperation._fn (C:\Users\USER\Documents\GitHub\chatbot-ui\node_modules\p-retry\index.js:50:12) {
  attemptNumber: 7,
  retriesLeft: 0
}

all working fine if i use OpenAI embedding or HuggingFace default modelSentenceSimilarityInputsCheck expected dict not list: `__root__` in `parameters`BeginnersHi, 
I’m new to ML/AI and haven’t experimented much yet. I am a experienced developer in my day job though. I’m having a few issues I’m hoping someone can help me with. My main goal is the following. 
I’m trying to write a bot that crawls a website, vectorizes all the text and stores this in pinecone db. Then the user can ask a question, and I query pinecone db for text that hopefully answers their question and feed that to chatgpt for it to answer the question. Everything seems to be working bu…
2024-10-04T12:21:00Z
Thanks@John6666!!! I’ve read it’s due to the pipeline_tag property of the model. It seems it must have the value ‘feature-extraction’.This model worked to me:async function query(data) {
	const response = await fetch(
		"https://api-inference.huggingface.co/models/facebook/bart-base",
		{
			headers: {
				Authorization: "Bearer REDACTED_TOKEN",
				"Content-Type": "application/json",
			},
			method: "POST",
			body: JSON.stringify(data),
		}
	);
	const result = await response.json();
	return result;
}

query({"inputs": "Today is a sunny day and I will get some ice cream."}).then((response) => {
	console.log(JSON.stringify(response));
});
2024-10-04T12:37:34Z
Wow. Was it a hit?It’s going to take a while for us to report back to the model authors and get them to fix it.It’s faster if you have a usable model.
2024-10-07T06:36:40Z
Let me know their answer!! Thanks again!
2024-10-07T06:55:24Z
Oh, no, I’m not reporting it because it seems to have worked. It’s hard when it doesn’t work …