update HF node

This commit is contained in:
Henry
2023-04-22 20:56:17 +01:00
parent ddabca2e0f
commit 1328e533d0
@@ -24,33 +24,24 @@ class HuggingFaceInference_LLMs implements INode {
{ {
label: 'Model', label: 'Model',
name: 'model', name: 'model',
type: 'options', type: 'string',
options: [ placeholder: 'gpt2'
{
label: 'gpt2',
name: 'gpt2'
}
],
default: 'gpt2',
optional: true
}, },
{ {
label: 'Temperature', label: 'HuggingFace Api Key',
name: 'temperature', name: 'apiKey',
type: 'number', type: 'password'
default: 0.7,
optional: true
} }
] ]
} }
async init(nodeData: INodeData): Promise<any> { async init(nodeData: INodeData): Promise<any> {
const temperature = nodeData.inputs?.temperature as string
const model = nodeData.inputs?.model as string const model = nodeData.inputs?.model as string
const apiKey = nodeData.inputs?.apiKey as string
const huggingFace = new HuggingFaceInference({ const huggingFace = new HuggingFaceInference({
temperature: parseInt(temperature, 10), model,
model apiKey
}) })
return huggingFace return huggingFace
} }