Merge branch 'SillyTavern:staging' into staging

This commit is contained in:
Tony Ribeiro 2023-08-16 19:19:29 +02:00 committed by GitHub
commit 05504ebbb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -5,7 +5,7 @@ TODO:
*/ */
import { saveSettingsDebounced } from "../../../script.js"; import { saveSettingsDebounced } from "../../../script.js";
import { getContext, getApiUrl, extension_settings, doExtrasFetch, ModuleWorkerWrapper } from "../../extensions.js"; import { getContext, getApiUrl, extension_settings, doExtrasFetch, ModuleWorkerWrapper, modules } from "../../extensions.js";
export { MODULE_NAME, rvcVoiceConversion}; export { MODULE_NAME, rvcVoiceConversion};
const MODULE_NAME = 'RVC'; const MODULE_NAME = 'RVC';
@ -68,7 +68,7 @@ function loadSettings() {
$('#rvc_filter_radius').val(extension_settings.rvc.filterRadius); $('#rvc_filter_radius').val(extension_settings.rvc.filterRadius);
$("#rvc_filter_radius_value").text(extension_settings.rvc.filterRadius); $("#rvc_filter_radius_value").text(extension_settings.rvc.filterRadius);
$('#rvc_pitch_offset').val(extension_settings.rvc.pitchOffset); $('#rvc_pitch_offset').val(extension_settings.rvc.pitchOffset);
$('#rvc_pitch_offset_value').text(extension_settings.rvc.pitchOffset); $('#rvc_pitch_offset_value').text(extension_settings.rvc.pitchOffset);
@ -226,7 +226,7 @@ $(document).ready(function () {
<label for="rvc_protect">Protect amount (<span id="rvc_protect_value"></span>)</label> <label for="rvc_protect">Protect amount (<span id="rvc_protect_value"></span>)</label>
<input id="rvc_protect" type="range" min="0" max="1" step="0.01" value="0.33" /> <input id="rvc_protect" type="range" min="0" max="1" step="0.01" value="0.33" />
<div id="rvc_status"> <div id="rvc_status">
</div> </div>
<div class="rvc_buttons"> <div class="rvc_buttons">
@ -249,7 +249,7 @@ $(document).ready(function () {
$('#rvc_protect').on('input', onProtectChange); $('#rvc_protect').on('input', onProtectChange);
$("#rvc_apply").on("click", onApplyClick); $("#rvc_apply").on("click", onApplyClick);
$("#rvc_delete").on("click", onDeleteClick); $("#rvc_delete").on("click", onDeleteClick);
} }
addExtensionControls(); // No init dependencies addExtensionControls(); // No init dependencies
loadSettings(); // Depends on Extension Controls loadSettings(); // Depends on Extension Controls
@ -316,7 +316,7 @@ async function rvcVoiceConversion(response, character) {
"rmsMixRate": voice_settings["rmsMixRate"], "rmsMixRate": voice_settings["rmsMixRate"],
"protect": voice_settings["protect"] "protect": voice_settings["protect"]
})); }));
const url = new URL(getApiUrl()); const url = new URL(getApiUrl());
url.pathname = '/api/voice-conversion/rvc/process-audio'; url.pathname = '/api/voice-conversion/rvc/process-audio';
@ -340,7 +340,7 @@ async function rvcVoiceConversion(response, character) {
async function moduleWorker() { async function moduleWorker() {
updateCharactersList(); updateCharactersList();
if (rvcModelsList.length == 0) { if (modules.includes('rvc') && rvcModelsList.length == 0) {
let result = await get_models_list(); let result = await get_models_list();
result = await result.json(); result = await result.json();
rvcModelsList = result["models_list"] rvcModelsList = result["models_list"]
@ -351,7 +351,7 @@ async function moduleWorker() {
.end() .end()
.append('<option value="none">Select Voice</option>') .append('<option value="none">Select Voice</option>')
.val('none') .val('none')
for(const modelName of rvcModelsList) { for(const modelName of rvcModelsList) {
$("#rvc_model_select").append(new Option(modelName,modelName)); $("#rvc_model_select").append(new Option(modelName,modelName));
} }
@ -367,7 +367,7 @@ function updateCharactersList() {
} }
currentcharacters = Array.from(currentcharacters) currentcharacters = Array.from(currentcharacters)
if (JSON.stringify(charactersList) !== JSON.stringify(currentcharacters)) { if (JSON.stringify(charactersList) !== JSON.stringify(currentcharacters)) {
charactersList = currentcharacters charactersList = currentcharacters
@ -377,11 +377,11 @@ function updateCharactersList() {
.end() .end()
.append('<option value="none">Select Character</option>') .append('<option value="none">Select Character</option>')
.val('none') .val('none')
for(const charName of charactersList) { for(const charName of charactersList) {
$("#rvc_character_select").append(new Option(charName,charName)); $("#rvc_character_select").append(new Option(charName,charName));
} }
console.debug(DEBUG_PREFIX,"Updated character list to:", charactersList); console.debug(DEBUG_PREFIX,"Updated character list to:", charactersList);
} }
} }