refactor temperature/top-p parsing for clarity
This commit is contained in:
+2
-2
@@ -61551,8 +61551,8 @@ async function run() {
|
|||||||
// Get temperature and topP (prompt YAML modelParameters takes precedence over action inputs)
|
// Get temperature and topP (prompt YAML modelParameters takes precedence over action inputs)
|
||||||
const temperatureInput = coreExports.getInput('temperature');
|
const temperatureInput = coreExports.getInput('temperature');
|
||||||
const topPInput = coreExports.getInput('top-p');
|
const topPInput = coreExports.getInput('top-p');
|
||||||
const temperature = promptConfig?.modelParameters?.temperature ?? (temperatureInput !== '' ? parseFloat(temperatureInput) : undefined);
|
const temperature = promptConfig?.modelParameters?.temperature ?? (temperatureInput ? parseFloat(temperatureInput) : undefined);
|
||||||
const topP = promptConfig?.modelParameters?.topP ?? (topPInput !== '' ? parseFloat(topPInput) : undefined);
|
const topP = promptConfig?.modelParameters?.topP ?? (topPInput ? parseFloat(topPInput) : undefined);
|
||||||
// Parse custom headers
|
// Parse custom headers
|
||||||
const customHeadersInput = coreExports.getInput('custom-headers');
|
const customHeadersInput = coreExports.getInput('custom-headers');
|
||||||
const customHeaders = parseCustomHeaders(customHeadersInput);
|
const customHeaders = parseCustomHeaders(customHeadersInput);
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
@@ -69,8 +69,8 @@ export async function run(): Promise<void> {
|
|||||||
const temperatureInput = core.getInput('temperature')
|
const temperatureInput = core.getInput('temperature')
|
||||||
const topPInput = core.getInput('top-p')
|
const topPInput = core.getInput('top-p')
|
||||||
const temperature =
|
const temperature =
|
||||||
promptConfig?.modelParameters?.temperature ?? (temperatureInput !== '' ? parseFloat(temperatureInput) : undefined)
|
promptConfig?.modelParameters?.temperature ?? (temperatureInput ? parseFloat(temperatureInput) : undefined)
|
||||||
const topP = promptConfig?.modelParameters?.topP ?? (topPInput !== '' ? parseFloat(topPInput) : 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')
|
||||||
|
|||||||
Reference in New Issue
Block a user