mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Lint fix
This commit is contained in:
@@ -29,28 +29,28 @@ class XTTSTtsProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
languageLabels = {
|
languageLabels = {
|
||||||
"Arabic": "ar",
|
'Arabic': 'ar',
|
||||||
"Brazilian Portuguese": "pt",
|
'Brazilian Portuguese': 'pt',
|
||||||
"Chinese": "zh-cn",
|
'Chinese': 'zh-cn',
|
||||||
"Czech": "cs",
|
'Czech': 'cs',
|
||||||
"Dutch": "nl",
|
'Dutch': 'nl',
|
||||||
"English": "en",
|
'English': 'en',
|
||||||
"French": "fr",
|
'French': 'fr',
|
||||||
"German": "de",
|
'German': 'de',
|
||||||
"Italian": "it",
|
'Italian': 'it',
|
||||||
"Polish": "pl",
|
'Polish': 'pl',
|
||||||
"Russian": "ru",
|
'Russian': 'ru',
|
||||||
"Spanish": "es",
|
'Spanish': 'es',
|
||||||
"Turkish": "tr",
|
'Turkish': 'tr',
|
||||||
"Japanese": "ja",
|
'Japanese': 'ja',
|
||||||
"Korean": "ko",
|
'Korean': 'ko',
|
||||||
"Hungarian": "hu",
|
'Hungarian': 'hu',
|
||||||
"Hindi": "hi",
|
'Hindi': 'hi',
|
||||||
}
|
};
|
||||||
|
|
||||||
defaultSettings = {
|
defaultSettings = {
|
||||||
provider_endpoint: "http://localhost:8020",
|
provider_endpoint: 'http://localhost:8020',
|
||||||
language: "en",
|
language: 'en',
|
||||||
temperature : 0.75,
|
temperature : 0.75,
|
||||||
length_penalty : 1.0,
|
length_penalty : 1.0,
|
||||||
repetition_penalty: 5.0,
|
repetition_penalty: 5.0,
|
||||||
@@ -61,7 +61,7 @@ class XTTSTtsProvider {
|
|||||||
stream_chunk_size: 100,
|
stream_chunk_size: 100,
|
||||||
voiceMap: {},
|
voiceMap: {},
|
||||||
streaming: false,
|
streaming: false,
|
||||||
}
|
};
|
||||||
|
|
||||||
get settingsHtml() {
|
get settingsHtml() {
|
||||||
let html = `
|
let html = `
|
||||||
@@ -125,8 +125,8 @@ class XTTSTtsProvider {
|
|||||||
}
|
}
|
||||||
onSettingsChange() {
|
onSettingsChange() {
|
||||||
// Used when provider settings are updated from UI
|
// Used when provider settings are updated from UI
|
||||||
this.settings.provider_endpoint = $('#xtts_tts_endpoint').val()
|
this.settings.provider_endpoint = $('#xtts_tts_endpoint').val();
|
||||||
this.settings.language = $('#xtts_api_language').val()
|
this.settings.language = $('#xtts_api_language').val();
|
||||||
|
|
||||||
// Update the default TTS settings based on input fields
|
// Update the default TTS settings based on input fields
|
||||||
this.settings.speed = $('#xtts_speed').val();
|
this.settings.speed = $('#xtts_speed').val();
|
||||||
@@ -148,8 +148,8 @@ class XTTSTtsProvider {
|
|||||||
$('#xtts_top_p_output').text(this.settings.top_p);
|
$('#xtts_top_p_output').text(this.settings.top_p);
|
||||||
$('#xtts_stream_chunk_size_output').text(this.settings.stream_chunk_size);
|
$('#xtts_stream_chunk_size_output').text(this.settings.stream_chunk_size);
|
||||||
|
|
||||||
saveTtsProviderSettings()
|
saveTtsProviderSettings();
|
||||||
this.changeTTSSetting()
|
this.changeTTSSetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -198,15 +198,15 @@ class XTTSTtsProvider {
|
|||||||
$('#xtts_enable_text_splitting').prop('checked', this.settings.enable_text_splitting);
|
$('#xtts_enable_text_splitting').prop('checked', this.settings.enable_text_splitting);
|
||||||
|
|
||||||
// Register input/change event listeners to update settings on user interaction
|
// Register input/change event listeners to update settings on user interaction
|
||||||
$('#xtts_speed').on("input", () => { this.onSettingsChange() });
|
$('#xtts_speed').on('input', () => { this.onSettingsChange(); });
|
||||||
$('#xtts_temperature').on("input", () => { this.onSettingsChange() });
|
$('#xtts_temperature').on('input', () => { this.onSettingsChange(); });
|
||||||
$('#xtts_length_penalty').on("input", () => { this.onSettingsChange() });
|
$('#xtts_length_penalty').on('input', () => { this.onSettingsChange(); });
|
||||||
$('#xtts_repetition_penalty').on("input", () => { this.onSettingsChange() });
|
$('#xtts_repetition_penalty').on('input', () => { this.onSettingsChange(); });
|
||||||
$('#xtts_top_k').on("input", () => { this.onSettingsChange() });
|
$('#xtts_top_k').on('input', () => { this.onSettingsChange(); });
|
||||||
$('#xtts_top_p').on("input", () => { this.onSettingsChange() });
|
$('#xtts_top_p').on('input', () => { this.onSettingsChange(); });
|
||||||
$('#xtts_enable_text_splitting').on("change", () => { this.onSettingsChange() });
|
$('#xtts_enable_text_splitting').on('change', () => { this.onSettingsChange(); });
|
||||||
|
|
||||||
$('#xtts_stream_chunk_size').on("input", () => { this.onSettingsChange() });
|
$('#xtts_stream_chunk_size').on('input', () => { this.onSettingsChange(); });
|
||||||
$('#xtts_tts_streaming').prop('checked', this.settings.streaming);
|
$('#xtts_tts_streaming').prop('checked', this.settings.streaming);
|
||||||
$('#xtts_tts_streaming').on('change', () => { this.onSettingsChange(); });
|
$('#xtts_tts_streaming').on('change', () => { this.onSettingsChange(); });
|
||||||
|
|
||||||
@@ -266,25 +266,25 @@ class XTTSTtsProvider {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Cache-Control': 'no-cache'
|
'Cache-Control': 'no-cache',
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
"temperature": this.settings.temperature,
|
'temperature': this.settings.temperature,
|
||||||
"speed": this.settings.speed,
|
'speed': this.settings.speed,
|
||||||
"length_penalty": this.settings.length_penalty,
|
'length_penalty': this.settings.length_penalty,
|
||||||
"repetition_penalty": this.settings.repetition_penalty,
|
'repetition_penalty': this.settings.repetition_penalty,
|
||||||
"top_p": this.settings.top_p,
|
'top_p': this.settings.top_p,
|
||||||
"top_k": this.settings.top_k,
|
'top_k': this.settings.top_k,
|
||||||
"enable_text_splitting": this.settings.enable_text_splitting,
|
'enable_text_splitting': this.settings.enable_text_splitting,
|
||||||
"stream_chunk_size": this.settings.stream_chunk_size
|
'stream_chunk_size': this.settings.stream_chunk_size,
|
||||||
})
|
}),
|
||||||
}
|
},
|
||||||
)
|
);
|
||||||
return response
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetchTtsGeneration(inputText, voiceId) {
|
async fetchTtsGeneration(inputText, voiceId) {
|
||||||
console.info(`Generating new TTS for voice_id ${voiceId}`)
|
console.info(`Generating new TTS for voice_id ${voiceId}`);
|
||||||
|
|
||||||
if (this.settings.streaming) {
|
if (this.settings.streaming) {
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
|
Reference in New Issue
Block a user