forked from open-webui/open-webui
Merge branch 'main' into docs/readme
This commit is contained in:
commit
9abee7e263
5 changed files with 68 additions and 12 deletions
|
@ -12,7 +12,8 @@
|
||||||
top_k: '',
|
top_k: '',
|
||||||
top_p: '',
|
top_p: '',
|
||||||
tfs_z: '',
|
tfs_z: '',
|
||||||
num_ctx: ''
|
num_ctx: '',
|
||||||
|
num_predict: ''
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -507,4 +508,49 @@
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
<div class=" py-0.5 w-full justify-between">
|
||||||
|
<div class="flex w-full justify-between">
|
||||||
|
<div class=" self-center text-xs font-medium">Max Tokens</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="p-1 px-3 text-xs flex rounded transition"
|
||||||
|
type="button"
|
||||||
|
on:click={() => {
|
||||||
|
options.num_predict = options.num_predict === '' ? 128 : '';
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{#if options.num_predict === ''}
|
||||||
|
<span class="ml-2 self-center"> Default </span>
|
||||||
|
{:else}
|
||||||
|
<span class="ml-2 self-center"> Custom </span>
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{#if options.num_predict !== ''}
|
||||||
|
<div class="flex mt-0.5 space-x-2">
|
||||||
|
<div class=" flex-1">
|
||||||
|
<input
|
||||||
|
id="steps-range"
|
||||||
|
type="range"
|
||||||
|
min="-2"
|
||||||
|
max="16000"
|
||||||
|
step="1"
|
||||||
|
bind:value={options.num_predict}
|
||||||
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="">
|
||||||
|
<input
|
||||||
|
bind:value={options.num_predict}
|
||||||
|
type="number"
|
||||||
|
class=" bg-transparent text-center w-14"
|
||||||
|
min="-2"
|
||||||
|
max="16000"
|
||||||
|
step="1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -53,7 +53,8 @@
|
||||||
top_p: '',
|
top_p: '',
|
||||||
stop: '',
|
stop: '',
|
||||||
tfs_z: '',
|
tfs_z: '',
|
||||||
num_ctx: ''
|
num_ctx: '',
|
||||||
|
num_predict: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
// Models
|
// Models
|
||||||
|
@ -1132,7 +1133,8 @@
|
||||||
top_k: options.top_k !== '' ? options.top_k : undefined,
|
top_k: options.top_k !== '' ? options.top_k : undefined,
|
||||||
top_p: options.top_p !== '' ? options.top_p : undefined,
|
top_p: options.top_p !== '' ? options.top_p : undefined,
|
||||||
tfs_z: options.tfs_z !== '' ? options.tfs_z : undefined,
|
tfs_z: options.tfs_z !== '' ? options.tfs_z : undefined,
|
||||||
num_ctx: options.num_ctx !== '' ? options.num_ctx : undefined
|
num_ctx: options.num_ctx !== '' ? options.num_ctx : undefined,
|
||||||
|
num_predict: options.num_predict !== '' ? options.num_predict : undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
show = false;
|
show = false;
|
||||||
|
|
|
@ -379,10 +379,13 @@
|
||||||
}
|
}
|
||||||
: { content: message.content })
|
: { content: message.content })
|
||||||
})),
|
})),
|
||||||
temperature: $settings.temperature ?? undefined,
|
seed: $settings.options.seed ?? undefined,
|
||||||
top_p: $settings.top_p ?? undefined,
|
stop: $settings.options.stop ?? undefined,
|
||||||
num_ctx: $settings.num_ctx ?? undefined,
|
temperature: $settings.options.temperature ?? undefined,
|
||||||
frequency_penalty: $settings.repeat_penalty ?? undefined
|
top_p: $settings.options.top_p ?? undefined,
|
||||||
|
num_ctx: $settings.options.num_ctx ?? undefined,
|
||||||
|
frequency_penalty: $settings.options.repeat_penalty ?? undefined,
|
||||||
|
max_tokens: $settings.options.num_predict ?? undefined,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
).catch((err) => {
|
).catch((err) => {
|
||||||
|
|
|
@ -406,10 +406,13 @@
|
||||||
}
|
}
|
||||||
: { content: message.content })
|
: { content: message.content })
|
||||||
})),
|
})),
|
||||||
temperature: $settings.temperature ?? undefined,
|
seed: $settings.options.seed ?? undefined,
|
||||||
top_p: $settings.top_p ?? undefined,
|
stop: $settings.options.stop ?? undefined,
|
||||||
num_ctx: $settings.num_ctx ?? undefined,
|
temperature: $settings.options.temperature ?? undefined,
|
||||||
frequency_penalty: $settings.repeat_penalty ?? undefined
|
top_p: $settings.options.top_p ?? undefined,
|
||||||
|
num_ctx: $settings.options.num_ctx ?? undefined,
|
||||||
|
frequency_penalty: $settings.options.repeat_penalty ?? undefined,
|
||||||
|
max_tokens: $settings.options.num_predict ?? undefined,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
).catch((err) => {
|
).catch((err) => {
|
||||||
|
|
|
@ -51,7 +51,8 @@
|
||||||
top_k: '',
|
top_k: '',
|
||||||
top_p: '',
|
top_p: '',
|
||||||
tfs_z: '',
|
tfs_z: '',
|
||||||
num_ctx: ''
|
num_ctx: '',
|
||||||
|
num_predict: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
let modelfileCreator = null;
|
let modelfileCreator = null;
|
||||||
|
@ -73,6 +74,7 @@ ${options.top_k !== '' ? `PARAMETER top_k ${options.top_k}` : ''}
|
||||||
${options.top_p !== '' ? `PARAMETER top_p ${options.top_p}` : ''}
|
${options.top_p !== '' ? `PARAMETER top_p ${options.top_p}` : ''}
|
||||||
${options.tfs_z !== '' ? `PARAMETER tfs_z ${options.tfs_z}` : ''}
|
${options.tfs_z !== '' ? `PARAMETER tfs_z ${options.tfs_z}` : ''}
|
||||||
${options.num_ctx !== '' ? `PARAMETER num_ctx ${options.num_ctx}` : ''}
|
${options.num_ctx !== '' ? `PARAMETER num_ctx ${options.num_ctx}` : ''}
|
||||||
|
${options.num_predict !== '' ? `PARAMETER num_predict ${options.num_predict}` : ''}
|
||||||
SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
|
SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue