mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
lint: Comma dangle
This commit is contained in:
@@ -30,5 +30,5 @@ const parse = async (cardUrl, format) => {
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
parse: parse
|
||||
parse: parse,
|
||||
};
|
||||
|
@@ -107,28 +107,28 @@ const UNSAFE_EXTENSIONS = [
|
||||
const PALM_SAFETY = [
|
||||
{
|
||||
category: 'HARM_CATEGORY_DEROGATORY',
|
||||
threshold: 'BLOCK_NONE'
|
||||
threshold: 'BLOCK_NONE',
|
||||
},
|
||||
{
|
||||
category: 'HARM_CATEGORY_TOXICITY',
|
||||
threshold: 'BLOCK_NONE'
|
||||
threshold: 'BLOCK_NONE',
|
||||
},
|
||||
{
|
||||
category: 'HARM_CATEGORY_VIOLENCE',
|
||||
threshold: 'BLOCK_NONE'
|
||||
threshold: 'BLOCK_NONE',
|
||||
},
|
||||
{
|
||||
category: 'HARM_CATEGORY_SEXUAL',
|
||||
threshold: 'BLOCK_NONE'
|
||||
threshold: 'BLOCK_NONE',
|
||||
},
|
||||
{
|
||||
category: 'HARM_CATEGORY_MEDICAL',
|
||||
threshold: 'BLOCK_NONE'
|
||||
threshold: 'BLOCK_NONE',
|
||||
},
|
||||
{
|
||||
category: 'HARM_CATEGORY_DANGEROUS',
|
||||
threshold: 'BLOCK_NONE'
|
||||
}
|
||||
threshold: 'BLOCK_NONE',
|
||||
},
|
||||
];
|
||||
|
||||
const UPLOADS_PATH = './uploads';
|
||||
|
@@ -118,7 +118,7 @@ async function downloadChubCharacter(id) {
|
||||
body: JSON.stringify({
|
||||
'format': 'tavern',
|
||||
'fullPath': id,
|
||||
})
|
||||
}),
|
||||
});
|
||||
|
||||
if (!result.ok) {
|
||||
@@ -164,12 +164,12 @@ function parseChubUrl(str) {
|
||||
const id = type === 'character' ? lastTwo.slice(1).join('/') : lastTwo.join('/');
|
||||
return {
|
||||
id: id,
|
||||
type: type
|
||||
type: type,
|
||||
};
|
||||
} else if (length === 2) {
|
||||
return {
|
||||
id: lastTwo.join('/'),
|
||||
type: 'character'
|
||||
type: 'character',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ async function downloadJannyCharacter(uuid) {
|
||||
headers: { 'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({
|
||||
'characterId': uuid,
|
||||
})
|
||||
}),
|
||||
});
|
||||
|
||||
if (result.ok) {
|
||||
|
@@ -71,7 +71,7 @@ function registerEndpoints(app, jsonParser) {
|
||||
'Content-Type': 'application/json',
|
||||
'apikey': api_key_horde,
|
||||
'Client-Agent': String(request.header('Client-Agent')),
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
if (!result.ok) {
|
||||
|
@@ -9,7 +9,7 @@ const API_NOVELAI = 'https://api.novelai.net';
|
||||
// Ban bracket generation, plus defaults
|
||||
const badWordsList = [
|
||||
[3], [49356], [1431], [31715], [34387], [20765], [30702], [10691], [49333], [1266],
|
||||
[19438], [43145], [26523], [41471], [2936], [85, 85], [49332], [7286], [1115]
|
||||
[19438], [43145], [26523], [41471], [2936], [85, 85], [49332], [7286], [1115],
|
||||
];
|
||||
|
||||
const hypeBotBadWordsList = [
|
||||
@@ -28,7 +28,7 @@ const hypeBotBadWordsList = [
|
||||
[41832], [41888], [42535], [42669], [42785], [42924], [43839], [44438], [44587],
|
||||
[44926], [45144], [45297], [46110], [46570], [46581], [46956], [47175], [47182],
|
||||
[47527], [47715], [48600], [48683], [48688], [48874], [48999], [49074], [49082],
|
||||
[49146], [49946], [10221], [4841], [1427], [2602, 834], [29343], [37405], [35780], [2602], [50256]
|
||||
[49146], [49946], [10221], [4841], [1427], [2602, 834], [29343], [37405], [35780], [2602], [50256],
|
||||
];
|
||||
|
||||
// Used for phrase repetition penalty
|
||||
@@ -36,13 +36,13 @@ const repPenaltyAllowList = [
|
||||
[49256, 49264, 49231, 49230, 49287, 85, 49255, 49399, 49262, 336, 333, 432, 363, 468, 492, 745, 401, 426, 623, 794,
|
||||
1096, 2919, 2072, 7379, 1259, 2110, 620, 526, 487, 16562, 603, 805, 761, 2681, 942, 8917, 653, 3513, 506, 5301,
|
||||
562, 5010, 614, 10942, 539, 2976, 462, 5189, 567, 2032, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 588,
|
||||
803, 1040, 49209, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
||||
803, 1040, 49209, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
||||
];
|
||||
|
||||
// Ban the dinkus and asterism
|
||||
const logitBiasExp = [
|
||||
{ 'sequence': [23], 'bias': -0.08, 'ensure_sequence_finish': false, 'generate_once': false },
|
||||
{ 'sequence': [21], 'bias': -0.08, 'ensure_sequence_finish': false, 'generate_once': false }
|
||||
{ 'sequence': [21], 'bias': -0.08, 'ensure_sequence_finish': false, 'generate_once': false },
|
||||
];
|
||||
|
||||
function getBadWordsList(model) {
|
||||
@@ -172,8 +172,8 @@ function registerEndpoints(app, jsonParser) {
|
||||
'use_cache': req.body.use_cache,
|
||||
'return_full_text': req.body.return_full_text,
|
||||
'prefix': req.body.prefix,
|
||||
'order': req.body.order
|
||||
}
|
||||
'order': req.body.order,
|
||||
},
|
||||
};
|
||||
|
||||
console.log(util.inspect(data, { depth: 4 }));
|
||||
|
@@ -23,7 +23,7 @@ async function getOpenAIVector(text) {
|
||||
body: JSON.stringify({
|
||||
input: text,
|
||||
model: 'text-embedding-ada-002',
|
||||
})
|
||||
}),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
@@ -34,11 +34,11 @@ function registerEndpoints(app, jsonParser, urlencodedParser) {
|
||||
role: 'user',
|
||||
content: [
|
||||
{ type: 'text', text: request.body.prompt },
|
||||
{ type: 'image_url', image_url: { 'url': request.body.image } }
|
||||
]
|
||||
}
|
||||
{ type: 'image_url', image_url: { 'url': request.body.image } },
|
||||
],
|
||||
},
|
||||
],
|
||||
max_tokens: 500
|
||||
max_tokens: 500,
|
||||
};
|
||||
|
||||
console.log('Multimodal captioning request', body);
|
||||
|
@@ -21,7 +21,7 @@ async function getPaLMVector(text) {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
text: text,
|
||||
})
|
||||
}),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
@@ -463,7 +463,7 @@ function registerEndpoints(app, jsonParser) {
|
||||
}
|
||||
const data = fs.readFileSync(
|
||||
path,
|
||||
{ encoding: 'utf-8' }
|
||||
{ encoding: 'utf-8' },
|
||||
);
|
||||
return response.send(JSON.stringify(data));
|
||||
} catch (error) {
|
||||
@@ -477,7 +477,7 @@ function registerEndpoints(app, jsonParser) {
|
||||
writeFileAtomicSync(
|
||||
`${DIRECTORIES.comfyWorkflows}/${sanitize(String(request.body.file_name))}`,
|
||||
request.body.workflow,
|
||||
'utf8'
|
||||
'utf8',
|
||||
);
|
||||
const data = getComfyWorkflows();
|
||||
return response.send(data);
|
||||
|
@@ -124,7 +124,7 @@ async function countSentencepieceTokens(tokenizer, text) {
|
||||
if (!instance) {
|
||||
return {
|
||||
ids: [],
|
||||
count: Math.ceil(text.length / CHARS_PER_TOKEN)
|
||||
count: Math.ceil(text.length / CHARS_PER_TOKEN),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ async function countSentencepieceTokens(tokenizer, text) {
|
||||
let ids = instance.encodeIds(cleaned);
|
||||
return {
|
||||
ids,
|
||||
count: ids.length
|
||||
count: ids.length,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -372,9 +372,9 @@ function registerEndpoints(app, jsonParser) {
|
||||
headers: {
|
||||
accept: 'application/json',
|
||||
'content-type': 'application/json',
|
||||
Authorization: `Bearer ${readSecret(SECRET_KEYS.AI21)}`
|
||||
Authorization: `Bearer ${readSecret(SECRET_KEYS.AI21)}`,
|
||||
},
|
||||
body: JSON.stringify({ text: req.body[0].content })
|
||||
body: JSON.stringify({ text: req.body[0].content }),
|
||||
};
|
||||
|
||||
try {
|
||||
|
@@ -37,9 +37,9 @@ function registerEndpoints(app, jsonParser) {
|
||||
source: 'auto',
|
||||
target: lang,
|
||||
format: 'text',
|
||||
api_key: key
|
||||
api_key: key,
|
||||
}),
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
|
||||
if (!result.ok) {
|
||||
|
@@ -256,7 +256,7 @@ const color = {
|
||||
blue: (mess) => color.byNum(mess, 34),
|
||||
magenta: (mess) => color.byNum(mess, 35),
|
||||
cyan: (mess) => color.byNum(mess, 36),
|
||||
white: (mess) => color.byNum(mess, 37)
|
||||
white: (mess) => color.byNum(mess, 37),
|
||||
};
|
||||
|
||||
function uuidv4() {
|
||||
|
Reference in New Issue
Block a user