Skip to content

Commit

Permalink
Merge pull request #29 from FlowiseAI/feature/HuggingFace
Browse files Browse the repository at this point in the history
Feature/Update HF node
  • Loading branch information
HenryHengZJ authored Apr 22, 2023
2 parents ddabca2 + 1328e53 commit 9ec0380
Showing 1 changed file with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> {
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
}
Expand Down

0 comments on commit 9ec0380

Please sign in to comment.