mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
update HF node
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user