feat(embedding-providers): load separately, add bert & bge

This commit is contained in:
ItzCrazyKns 2024-05-07 12:33:44 +05:30
parent 68837e06ee
commit 321e60b993
No known key found for this signature in database
GPG Key ID: 8162927C7CCE3065
1 changed files with 16 additions and 5 deletions

View File

@ -158,15 +158,26 @@ export const getAvailableEmbeddingModelProviders = async () => {
return acc; return acc;
}, {}); }, {});
models['local'] = {
'GTE Small': new HuggingFaceTransformersEmbeddings({
modelName: 'Xenova/gte-small',
}),
};
} catch (err) { } catch (err) {
logger.error(`Error loading Ollama embeddings: ${err}`); logger.error(`Error loading Ollama embeddings: ${err}`);
} }
} }
try {
models['local'] = {
'BGE Small': new HuggingFaceTransformersEmbeddings({
modelName: 'Xenova/bge-small-en-v1.5',
}),
'GTE Small': new HuggingFaceTransformersEmbeddings({
modelName: 'Xenova/gte-small',
}),
'Bert Multilingual': new HuggingFaceTransformersEmbeddings({
modelName: 'Xenova/bert-base-multilingual-uncased'
}),
};
} catch(err) {
logger.error(`Error loading local embeddings: ${err}`);
}
return models; return models;
}; };