Add min_new_tokens flag

This commit is contained in:
James S 2025-01-29 02:08:02 +00:00
parent 411d458549
commit a361f110ec

View File

@ -7,6 +7,7 @@ import 'dotenv/config';
const config = {
llmSettings: {
max_new_tokens: 128,
min_new_tokens: 1,
temperature: 0.9,
repetition_penalty: 1.5,
msg_context: 8
@ -22,6 +23,7 @@ async function configCommand(interaction: ChatInputCommandInteraction)
}
config.llmSettings.max_new_tokens = interaction.options.getInteger('max_new_tokens') ?? config.llmSettings.max_new_tokens;
config.llmSettings.min_new_tokens = interaction.options.getInteger('min_new_tokens') ?? config.llmSettings.min_new_tokens;
config.llmSettings.msg_context = interaction.options.getInteger('msg_context') ?? config.llmSettings.msg_context;
config.llmSettings.temperature = interaction.options.getNumber('temperature') ?? config.llmSettings.temperature;
config.llmSettings.repetition_penalty = interaction.options.getNumber('repetition_penalty') ?? config.llmSettings.repetition_penalty;
@ -29,6 +31,7 @@ async function configCommand(interaction: ChatInputCommandInteraction)
await interaction.reply(`
\`\`\`
max_new_tokens = ${config.llmSettings.max_new_tokens}
min_new_tokens = ${config.llmSettings.min_new_tokens}
msg_context = ${config.llmSettings.msg_context}
temperature = ${config.llmSettings.temperature}
repetition_penalty = ${config.llmSettings.repetition_penalty}
@ -50,6 +53,9 @@ export = {
.addIntegerOption(
opt => opt.setName('max_new_tokens').setDescription('Max. new tokens (default: 128)')
)
.addIntegerOption(
opt => opt.setName('min_new_tokens').setDescription('Min. new tokens (default: 1)')
)
.addIntegerOption(
opt => opt.setName('msg_context').setDescription('Num. messages in context (default: 8)')
)