Skip to content

Commit

Permalink
Merge branch 'SillyTavern:release' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
teralomaniac authored Nov 3, 2023
2 parents 5e3dd25 + 064d331 commit 9cc61b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
12 changes: 6 additions & 6 deletions public/scripts/cfg-scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async function modifyCharaHtml() {
function loadSettings() {
// Set chat CFG if it exists
$('#chat_cfg_guidance_scale').val(chat_metadata[metadataKeys.guidance_scale] ?? 1.0.toFixed(2));
$('#chat_cfg_guidance_scale_counter').text(chat_metadata[metadataKeys.guidance_scale]?.toFixed(2) ?? 1.0.toFixed(2));
$('#chat_cfg_guidance_scale_counter').val(chat_metadata[metadataKeys.guidance_scale]?.toFixed(2) ?? 1.0.toFixed(2));
$('#chat_cfg_negative_prompt').val(chat_metadata[metadataKeys.negative_prompt] ?? '');
$('#chat_cfg_positive_prompt').val(chat_metadata[metadataKeys.positive_prompt] ?? '');
$('#groupchat_cfg_use_chara').prop('checked', chat_metadata[metadataKeys.groupchat_individual_chars] ?? false);
Expand Down Expand Up @@ -211,7 +211,7 @@ function loadSettings() {
if (!selected_group) {
const charaCfg = extension_settings.cfg.chara.find((e) => e.name === getCharaFilename());
$('#chara_cfg_guidance_scale').val(charaCfg?.guidance_scale ?? 1.00);
$('#chara_cfg_guidance_scale_counter').text(charaCfg?.guidance_scale?.toFixed(2) ?? 1.0.toFixed(2));
$('#chara_cfg_guidance_scale_counter').val(charaCfg?.guidance_scale?.toFixed(2) ?? 1.0.toFixed(2));
$('#chara_cfg_negative_prompt').val(charaCfg?.negative_prompt ?? '');
$('#chara_cfg_positive_prompt').val(charaCfg?.positive_prompt ?? '');
}
Expand All @@ -228,7 +228,7 @@ async function initialLoadSettings() {

// Set global CFG values on load
$('#global_cfg_guidance_scale').val(extension_settings.cfg.global.guidance_scale);
$('#global_cfg_guidance_scale_counter').text(extension_settings.cfg.global.guidance_scale.toFixed(2));
$('#global_cfg_guidance_scale_counter').val(extension_settings.cfg.global.guidance_scale.toFixed(2));
$('#global_cfg_negative_prompt').val(extension_settings.cfg.global.negative_prompt);
$('#global_cfg_positive_prompt').val(extension_settings.cfg.global.positive_prompt);
}
Expand Down Expand Up @@ -291,7 +291,7 @@ export function initCfg() {
const numberValue = Number($(this).val());
const success = setChatCfg(numberValue, settingType.guidance_scale);
if (success) {
$('#chat_cfg_guidance_scale_counter').text(numberValue.toFixed(2));
$('#chat_cfg_guidance_scale_counter').val(numberValue.toFixed(2));
}
});

Expand All @@ -307,7 +307,7 @@ export function initCfg() {
const value = $(this).val();
const success = setCharCfg(value, settingType.guidance_scale);
if (success) {
$('#chara_cfg_guidance_scale_counter').text(Number(value).toFixed(2));
$('#chara_cfg_guidance_scale_counter').val(Number(value).toFixed(2));
}
});

Expand All @@ -321,7 +321,7 @@ export function initCfg() {

$('#global_cfg_guidance_scale').on('input', function() {
extension_settings.cfg.global.guidance_scale = Number($(this).val());
$('#global_cfg_guidance_scale_counter').text(extension_settings.cfg.global.guidance_scale.toFixed(2));
$('#global_cfg_guidance_scale_counter').val(extension_settings.cfg.global.guidance_scale.toFixed(2));
saveSettingsDebounced();
});

Expand Down
6 changes: 0 additions & 6 deletions src/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ function registerEndpoints(app, jsonParser) {
* @returns {void}
*/
app.post('/api/extensions/install', jsonParser, async (request, response) => {
const gitExists = commandExistsSync('git');

if (!gitExists) {
return response.status(400).send('Server Error: git is not installed on the system.');
}

if (!request.body.url) {
return response.status(400).send('Bad Request: URL is required in the request body.');
}
Expand Down
5 changes: 4 additions & 1 deletion src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ function registerEndpoints(app, jsonParser) {
}

const text = request.body.text;
const lang = request.body.lang;
let lang = request.body.lang;
if (request.body.lang === 'zh-CN') {
lang = 'ZH'
}

if (!text || !lang) {
return response.sendStatus(400);
Expand Down

0 comments on commit 9cc61b7

Please sign in to comment.