Timothy Jaeryang Baek 1 month ago
parent
commit
b15bf0dc70
1 changed files with 89 additions and 89 deletions
  1. 89 89
      src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte

+ 89 - 89
src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte

@@ -788,25 +788,23 @@
 
 	<div class=" py-0.5 w-full justify-between">
 		<Tooltip
-			content={$i18n.t(
-				'Control the repetition of token sequences in the generated text. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 1.1) will be more lenient. At 1, it is disabled.'
-			)}
+			content={$i18n.t('Sets how far back for the model to look back to prevent repetition.')}
 			placement="top-start"
 			className="inline-tooltip"
 		>
 			<div class="flex w-full justify-between">
 				<div class=" self-center text-xs font-medium">
-					{$i18n.t('Repeat Penalty (Ollama)')}
+					{$i18n.t('Repeat Last N')}
 				</div>
 
 				<button
-					class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
+					class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
 					type="button"
 					on:click={() => {
-						params.repeat_penalty = (params?.repeat_penalty ?? null) === null ? 1.1 : null;
+						params.repeat_last_n = (params?.repeat_last_n ?? null) === null ? 64 : null;
 					}}
 				>
-					{#if (params?.repeat_penalty ?? null) === null}
+					{#if (params?.repeat_last_n ?? null) === null}
 						<span class="ml-2 self-center">{$i18n.t('Default')}</span>
 					{:else}
 						<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
@@ -815,27 +813,27 @@
 			</div>
 		</Tooltip>
 
-		{#if (params?.repeat_penalty ?? null) !== null}
+		{#if (params?.repeat_last_n ?? null) !== null}
 			<div class="flex mt-0.5 space-x-2">
 				<div class=" flex-1">
 					<input
 						id="steps-range"
 						type="range"
-						min="-2"
-						max="2"
-						step="0.05"
-						bind:value={params.repeat_penalty}
+						min="-1"
+						max="128"
+						step="1"
+						bind:value={params.repeat_last_n}
 						class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
 					/>
 				</div>
 				<div>
 					<input
-						bind:value={params.repeat_penalty}
+						bind:value={params.repeat_last_n}
 						type="number"
 						class=" bg-transparent text-center w-14"
-						min="-2"
-						max="2"
-						step="any"
+						min="-1"
+						max="128"
+						step="1"
 					/>
 				</div>
 			</div>
@@ -844,23 +842,25 @@
 
 	<div class=" py-0.5 w-full justify-between">
 		<Tooltip
-			content={$i18n.t('Sets how far back for the model to look back to prevent repetition.')}
+			content={$i18n.t(
+				'Tail free sampling is used to reduce the impact of less probable tokens from the output. A higher value (e.g., 2.0) will reduce the impact more, while a value of 1.0 disables this setting.'
+			)}
 			placement="top-start"
 			className="inline-tooltip"
 		>
 			<div class="flex w-full justify-between">
 				<div class=" self-center text-xs font-medium">
-					{$i18n.t('Repeat Last N')}
+					{$i18n.t('Tfs Z')}
 				</div>
 
 				<button
 					class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
 					type="button"
 					on:click={() => {
-						params.repeat_last_n = (params?.repeat_last_n ?? null) === null ? 64 : null;
+						params.tfs_z = (params?.tfs_z ?? null) === null ? 1 : null;
 					}}
 				>
-					{#if (params?.repeat_last_n ?? null) === null}
+					{#if (params?.tfs_z ?? null) === null}
 						<span class="ml-2 self-center">{$i18n.t('Default')}</span>
 					{:else}
 						<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
@@ -869,27 +869,27 @@
 			</div>
 		</Tooltip>
 
-		{#if (params?.repeat_last_n ?? null) !== null}
+		{#if (params?.tfs_z ?? null) !== null}
 			<div class="flex mt-0.5 space-x-2">
 				<div class=" flex-1">
 					<input
 						id="steps-range"
 						type="range"
-						min="-1"
-						max="128"
-						step="1"
-						bind:value={params.repeat_last_n}
+						min="0"
+						max="2"
+						step="0.05"
+						bind:value={params.tfs_z}
 						class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
 					/>
 				</div>
 				<div>
 					<input
-						bind:value={params.repeat_last_n}
+						bind:value={params.tfs_z}
 						type="number"
 						class=" bg-transparent text-center w-14"
-						min="-1"
-						max="128"
-						step="1"
+						min="0"
+						max="2"
+						step="any"
 					/>
 				</div>
 			</div>
@@ -899,24 +899,24 @@
 	<div class=" py-0.5 w-full justify-between">
 		<Tooltip
 			content={$i18n.t(
-				'Tail free sampling is used to reduce the impact of less probable tokens from the output. A higher value (e.g., 2.0) will reduce the impact more, while a value of 1.0 disables this setting.'
+				'This option controls how many tokens are preserved when refreshing the context. For example, if set to 2, the last 2 tokens of the conversation context will be retained. Preserving context can help maintain the continuity of a conversation, but it may reduce the ability to respond to new topics.'
 			)}
 			placement="top-start"
 			className="inline-tooltip"
 		>
 			<div class="flex w-full justify-between">
 				<div class=" self-center text-xs font-medium">
-					{$i18n.t('Tfs Z')}
+					{$i18n.t('Tokens To Keep On Context Refresh (num_keep)')}
 				</div>
 
 				<button
 					class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
 					type="button"
 					on:click={() => {
-						params.tfs_z = (params?.tfs_z ?? null) === null ? 1 : null;
+						params.num_keep = (params?.num_keep ?? null) === null ? 24 : null;
 					}}
 				>
-					{#if (params?.tfs_z ?? null) === null}
+					{#if (params?.num_keep ?? null) === null}
 						<span class="ml-2 self-center">{$i18n.t('Default')}</span>
 					{:else}
 						<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
@@ -925,27 +925,26 @@
 			</div>
 		</Tooltip>
 
-		{#if (params?.tfs_z ?? null) !== null}
+		{#if (params?.num_keep ?? null) !== null}
 			<div class="flex mt-0.5 space-x-2">
 				<div class=" flex-1">
 					<input
 						id="steps-range"
 						type="range"
-						min="0"
-						max="2"
-						step="0.05"
-						bind:value={params.tfs_z}
+						min="-1"
+						max="10240000"
+						step="1"
+						bind:value={params.num_keep}
 						class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
 					/>
 				</div>
-				<div>
+				<div class="">
 					<input
-						bind:value={params.tfs_z}
+						bind:value={params.num_keep}
 						type="number"
 						class=" bg-transparent text-center w-14"
-						min="0"
-						max="2"
-						step="any"
+						min="-1"
+						step="1"
 					/>
 				</div>
 			</div>
@@ -954,24 +953,25 @@
 
 	<div class=" py-0.5 w-full justify-between">
 		<Tooltip
-			content={$i18n.t('Sets the size of the context window used to generate the next token.')}
+			content={$i18n.t(
+				'This option sets the maximum number of tokens the model can generate in its response. Increasing this limit allows the model to provide longer answers, but it may also increase the likelihood of unhelpful or irrelevant content being generated.'
+			)}
 			placement="top-start"
 			className="inline-tooltip"
 		>
 			<div class="flex w-full justify-between">
 				<div class=" self-center text-xs font-medium">
-					{$i18n.t('Context Length')}
-					{$i18n.t('(Ollama)')}
+					{$i18n.t('Max Tokens (num_predict)')}
 				</div>
 
 				<button
 					class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
 					type="button"
 					on:click={() => {
-						params.num_ctx = (params?.num_ctx ?? null) === null ? 2048 : null;
+						params.max_tokens = (params?.max_tokens ?? null) === null ? 128 : null;
 					}}
 				>
-					{#if (params?.num_ctx ?? null) === null}
+					{#if (params?.max_tokens ?? null) === null}
 						<span class="ml-2 self-center">{$i18n.t('Default')}</span>
 					{:else}
 						<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
@@ -980,25 +980,25 @@
 			</div>
 		</Tooltip>
 
-		{#if (params?.num_ctx ?? null) !== null}
+		{#if (params?.max_tokens ?? null) !== null}
 			<div class="flex mt-0.5 space-x-2">
 				<div class=" flex-1">
 					<input
 						id="steps-range"
 						type="range"
-						min="-1"
-						max="10240000"
+						min="-2"
+						max="131072"
 						step="1"
-						bind:value={params.num_ctx}
+						bind:value={params.max_tokens}
 						class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
 					/>
 				</div>
-				<div class="">
+				<div>
 					<input
-						bind:value={params.num_ctx}
+						bind:value={params.max_tokens}
 						type="number"
 						class=" bg-transparent text-center w-14"
-						min="-1"
+						min="-2"
 						step="1"
 					/>
 				</div>
@@ -1009,24 +1009,24 @@
 	<div class=" py-0.5 w-full justify-between">
 		<Tooltip
 			content={$i18n.t(
-				'The batch size determines how many text requests are processed together at once. A higher batch size can increase the performance and speed of the model, but it also requires more memory.'
+				'Control the repetition of token sequences in the generated text. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 1.1) will be more lenient. At 1, it is disabled.'
 			)}
 			placement="top-start"
 			className="inline-tooltip"
 		>
 			<div class="flex w-full justify-between">
 				<div class=" self-center text-xs font-medium">
-					{$i18n.t('Batch Size (num_batch)')}
+					{$i18n.t('Repeat Penalty (Ollama)')}
 				</div>
 
 				<button
-					class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
+					class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
 					type="button"
 					on:click={() => {
-						params.num_batch = (params?.num_batch ?? null) === null ? 512 : null;
+						params.repeat_penalty = (params?.repeat_penalty ?? null) === null ? 1.1 : null;
 					}}
 				>
-					{#if (params?.num_batch ?? null) === null}
+					{#if (params?.repeat_penalty ?? null) === null}
 						<span class="ml-2 self-center">{$i18n.t('Default')}</span>
 					{:else}
 						<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
@@ -1035,26 +1035,27 @@
 			</div>
 		</Tooltip>
 
-		{#if (params?.num_batch ?? null) !== null}
+		{#if (params?.repeat_penalty ?? null) !== null}
 			<div class="flex mt-0.5 space-x-2">
 				<div class=" flex-1">
 					<input
 						id="steps-range"
 						type="range"
-						min="256"
-						max="8192"
-						step="256"
-						bind:value={params.num_batch}
+						min="-2"
+						max="2"
+						step="0.05"
+						bind:value={params.repeat_penalty}
 						class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
 					/>
 				</div>
 				<div>
 					<input
-						bind:value={params.num_batch}
+						bind:value={params.repeat_penalty}
 						type="number"
 						class=" bg-transparent text-center w-14"
-						min="256"
-						step="256"
+						min="-2"
+						max="2"
+						step="any"
 					/>
 				</div>
 			</div>
@@ -1063,25 +1064,24 @@
 
 	<div class=" py-0.5 w-full justify-between">
 		<Tooltip
-			content={$i18n.t(
-				'This option controls how many tokens are preserved when refreshing the context. For example, if set to 2, the last 2 tokens of the conversation context will be retained. Preserving context can help maintain the continuity of a conversation, but it may reduce the ability to respond to new topics.'
-			)}
+			content={$i18n.t('Sets the size of the context window used to generate the next token.')}
 			placement="top-start"
 			className="inline-tooltip"
 		>
 			<div class="flex w-full justify-between">
 				<div class=" self-center text-xs font-medium">
-					{$i18n.t('Tokens To Keep On Context Refresh (num_keep)')}
+					{$i18n.t('Context Length')}
+					{$i18n.t('(Ollama)')}
 				</div>
 
 				<button
 					class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
 					type="button"
 					on:click={() => {
-						params.num_keep = (params?.num_keep ?? null) === null ? 24 : null;
+						params.num_ctx = (params?.num_ctx ?? null) === null ? 2048 : null;
 					}}
 				>
-					{#if (params?.num_keep ?? null) === null}
+					{#if (params?.num_ctx ?? null) === null}
 						<span class="ml-2 self-center">{$i18n.t('Default')}</span>
 					{:else}
 						<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
@@ -1090,7 +1090,7 @@
 			</div>
 		</Tooltip>
 
-		{#if (params?.num_keep ?? null) !== null}
+		{#if (params?.num_ctx ?? null) !== null}
 			<div class="flex mt-0.5 space-x-2">
 				<div class=" flex-1">
 					<input
@@ -1099,13 +1099,13 @@
 						min="-1"
 						max="10240000"
 						step="1"
-						bind:value={params.num_keep}
+						bind:value={params.num_ctx}
 						class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
 					/>
 				</div>
 				<div class="">
 					<input
-						bind:value={params.num_keep}
+						bind:value={params.num_ctx}
 						type="number"
 						class=" bg-transparent text-center w-14"
 						min="-1"
@@ -1119,24 +1119,24 @@
 	<div class=" py-0.5 w-full justify-between">
 		<Tooltip
 			content={$i18n.t(
-				'This option sets the maximum number of tokens the model can generate in its response. Increasing this limit allows the model to provide longer answers, but it may also increase the likelihood of unhelpful or irrelevant content being generated.'
+				'The batch size determines how many text requests are processed together at once. A higher batch size can increase the performance and speed of the model, but it also requires more memory.'
 			)}
 			placement="top-start"
 			className="inline-tooltip"
 		>
 			<div class="flex w-full justify-between">
 				<div class=" self-center text-xs font-medium">
-					{$i18n.t('Max Tokens (num_predict)')}
+					{$i18n.t('Batch Size (num_batch)')}
 				</div>
 
 				<button
 					class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
 					type="button"
 					on:click={() => {
-						params.max_tokens = (params?.max_tokens ?? null) === null ? 128 : null;
+						params.num_batch = (params?.num_batch ?? null) === null ? 512 : null;
 					}}
 				>
-					{#if (params?.max_tokens ?? null) === null}
+					{#if (params?.num_batch ?? null) === null}
 						<span class="ml-2 self-center">{$i18n.t('Default')}</span>
 					{:else}
 						<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
@@ -1145,26 +1145,26 @@
 			</div>
 		</Tooltip>
 
-		{#if (params?.max_tokens ?? null) !== null}
+		{#if (params?.num_batch ?? null) !== null}
 			<div class="flex mt-0.5 space-x-2">
 				<div class=" flex-1">
 					<input
 						id="steps-range"
 						type="range"
-						min="-2"
-						max="131072"
-						step="1"
-						bind:value={params.max_tokens}
+						min="256"
+						max="8192"
+						step="256"
+						bind:value={params.num_batch}
 						class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
 					/>
 				</div>
 				<div>
 					<input
-						bind:value={params.max_tokens}
+						bind:value={params.num_batch}
 						type="number"
 						class=" bg-transparent text-center w-14"
-						min="-2"
-						step="1"
+						min="256"
+						step="256"
 					/>
 				</div>
 			</div>