fix(Hugging Face Inference Model Node, Embeddings Hugging Face Inference Node): Fix credential validation for HF nodes and add provider for (#18047)

This commit is contained in:
Mutasem Aldmour
2025-08-06 14:29:10 +02:00
committed by GitHub
parent 2a5c1e2152
commit a1682e8fe4
5 changed files with 48 additions and 16 deletions

View File

@@ -55,7 +55,7 @@ export class LmOpenHuggingFaceInference implements INodeType {
displayName: 'Model',
name: 'model',
type: 'string',
default: 'gpt2',
default: 'mistralai/Mistral-Nemo-Base-2407',
},
{
displayName: 'Options',
@@ -139,6 +139,11 @@ export class LmOpenHuggingFaceInference implements INodeType {
const modelName = this.getNodeParameter('model', itemIndex) as string;
const options = this.getNodeParameter('options', itemIndex, {}) as object;
// LangChain does not yet support specifying Provider
// That's why mistral's model is the default value
// It is one of the few models that seem to work out of the box
// Other models are returning "Model x/y is not supported for task text-generation and provider z. Supported task: conversational."
// https://github.com/langchain-ai/langchainjs/discussions/8434#discussioncomment-13603787
const model = new HuggingFaceInference({
model: modelName,
apiKey: credentials.apiKey as string,