huggingface / huggingface.js

Utilities to use the Hugging Face Hub API
https://hf.co/docs/huggingface.js
MIT License
1.36k stars 199 forks source link

Error with SGPT model: __init__() got an unexpected keyword argument 'pooling_mode_weightedmean_tokens' #280

Open Ncifra opened 10 months ago

Ncifra commented 10 months ago

Hi,

I am trying to run these embeddings with langchain, and get the above error. This is the stacktrace:

Error: __init__() got an unexpected keyword argument 'pooling_mode_weightedmean_tokens'
    at request (/home/user/langchain-test/node_modules/@huggingface/inference/dist/index.js:215:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async featureExtraction (/home/user/langchain-test/node_modules/@huggingface/inference/dist/index.js:603:15)
    at async RetryOperation._fn (/home/user/langchain-test/node_modules/p-retry/index.js:50:12) {
  attemptNumber: 7,
  retriesLeft: 0
}

This is the relevant part of the code that throws:

    const embeddings = new HuggingFaceInferenceEmbeddings({
        model: 'Muennighoff/SGPT-125M-weightedmean-msmarco-specb-bitfit',
        apiKey: 'xxx'
    });

    const vectorStore = await MemoryVectorStore.fromDocuments(
        splitDocs,
        embeddings
    );
coyotte508 commented 10 months ago

cc @OlivierDehaene maybe, at least the python error on inference server should not reference __init__?