add temperature and top-p input parameters
This commit is contained in:
@@ -46,6 +46,14 @@ inputs:
|
|||||||
description: The maximum number of tokens to generate
|
description: The maximum number of tokens to generate
|
||||||
required: false
|
required: false
|
||||||
default: '200'
|
default: '200'
|
||||||
|
temperature:
|
||||||
|
description: The sampling temperature to use (0-1)
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
top-p:
|
||||||
|
description: The nucleus sampling parameter to use (0-1)
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
token:
|
token:
|
||||||
description: The token to use
|
description: The token to use
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
+9
-2
@@ -65,6 +65,13 @@ export async function run(): Promise<void> {
|
|||||||
|
|
||||||
const endpoint = core.getInput('endpoint')
|
const endpoint = core.getInput('endpoint')
|
||||||
|
|
||||||
|
// Get temperature and topP (prompt YAML modelParameters takes precedence over action inputs)
|
||||||
|
const temperatureInput = core.getInput('temperature')
|
||||||
|
const topPInput = core.getInput('top-p')
|
||||||
|
const temperature =
|
||||||
|
promptConfig?.modelParameters?.temperature ?? (temperatureInput !== '' ? parseFloat(temperatureInput) : undefined)
|
||||||
|
const topP = promptConfig?.modelParameters?.topP ?? (topPInput !== '' ? parseFloat(topPInput) : undefined)
|
||||||
|
|
||||||
// Parse custom headers
|
// Parse custom headers
|
||||||
const customHeadersInput = core.getInput('custom-headers')
|
const customHeadersInput = core.getInput('custom-headers')
|
||||||
const customHeaders = parseCustomHeaders(customHeadersInput)
|
const customHeaders = parseCustomHeaders(customHeadersInput)
|
||||||
@@ -75,8 +82,8 @@ export async function run(): Promise<void> {
|
|||||||
systemPrompt,
|
systemPrompt,
|
||||||
prompt,
|
prompt,
|
||||||
modelName,
|
modelName,
|
||||||
promptConfig?.modelParameters?.temperature,
|
temperature,
|
||||||
promptConfig?.modelParameters?.topP,
|
topP,
|
||||||
maxTokens,
|
maxTokens,
|
||||||
endpoint,
|
endpoint,
|
||||||
token,
|
token,
|
||||||
|
|||||||
Reference in New Issue
Block a user