From 1328e533d03b7eb7756c04669d1067a934529276 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 22 Apr 2023 20:56:17 +0100 Subject: [PATCH] update HF node --- .../HuggingFaceInference.ts | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/packages/components/nodes/llms/HuggingFaceInference/HuggingFaceInference.ts b/packages/components/nodes/llms/HuggingFaceInference/HuggingFaceInference.ts index b33c72db..6aa3f4f4 100644 --- a/packages/components/nodes/llms/HuggingFaceInference/HuggingFaceInference.ts +++ b/packages/components/nodes/llms/HuggingFaceInference/HuggingFaceInference.ts @@ -24,33 +24,24 @@ class HuggingFaceInference_LLMs implements INode { { label: 'Model', name: 'model', - type: 'options', - options: [ - { - label: 'gpt2', - name: 'gpt2' - } - ], - default: 'gpt2', - optional: true + type: 'string', + placeholder: 'gpt2' }, { - label: 'Temperature', - name: 'temperature', - type: 'number', - default: 0.7, - optional: true + label: 'HuggingFace Api Key', + name: 'apiKey', + type: 'password' } ] } async init(nodeData: INodeData): Promise { - const temperature = nodeData.inputs?.temperature as string const model = nodeData.inputs?.model as string + const apiKey = nodeData.inputs?.apiKey as string const huggingFace = new HuggingFaceInference({ - temperature: parseInt(temperature, 10), - model + model, + apiKey }) return huggingFace }