aphrodite: send an empty sampler priority list if using the default order

bcbfcb87b52c03f4d2aa50e2efe95ffafeda515d

AlpinDale <alpindale@gmail.com>

2 files changed, +23 -2Ignore whitespace
public/scripts/textgen-settings.js+6 -2
@@ -16,7 +16,7 @@ import { power_user, registerDebugFunction } from './power-user.js';
1616import { getEventSourceStream } from './sse-stream.js';
1717import { getCurrentDreamGenModelTokenizer, getCurrentOpenRouterModelTokenizer } from './textgen-models.js';
1818import { ENCODE_TOKENIZERS, TEXTGEN_TOKENIZERS, getTextTokens, tokenizers } from './tokenizers.js';
1919import { getSortableDelay, onlyUnique, arraysEqual } from './utils.js';
2020
2121export const textgen_types = {
2222 OOBA: 'ooba',
@@ -1316,7 +1316,11 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
13161316 'nsigma': settings.nsigma,
13171317 'custom_token_bans': toIntArray(banned_tokens),
13181318 'no_repeat_ngram_size': settings.no_repeat_ngram_size,
13191319 'sampler_priority': settings.type === APHRODITE ? settings.samplers_priorities :&& undefined,!arraysEqual(
1320+ settings.samplers_priorities,
1321+ APHRODITE_DEFAULT_ORDER)
1322+ ? settings.samplers_priorities
1323+ : undefined,
13201324 };
13211325
13221326 if (settings.type === OPENROUTER) {
public/scripts/utils.js+17 -0
@@ -2173,3 +2173,20 @@ export function getCharIndex(char) {
21732173 if (index === -1) throw new Error(`Character not found: ${char.avatar}`);
21742174 return index;
21752175}
2176+
2177+/**
2178+ * Compares two arrays for equality
2179+ * @param {any[]} a - The first array
2180+ * @param {any[]} b - The second array
2181+ * @returns {boolean} True if the arrays are equal, false otherwise
2182+ */
2183+export function arraysEqual(a, b) {
2184+ if (a === b) return true;
2185+ if (a == null || b == null) return false;
2186+ if (a.length !== b.length) return false;
2187+
2188+ for (let i = 0; i < a.length; i++) {
2189+ if (a[i] !== b[i]) return false;
2190+ }
2191+ return true;
2192+}