Spaces:
Paused
Paused
Update main.ts
Browse files
main.ts
CHANGED
|
@@ -287,6 +287,7 @@ async function handleDemoRequest(req: Request) {
|
|
| 287 |
const option = document.createElement('option');
|
| 288 |
option.value = model.model;
|
| 289 |
option.textContent = model.model;
|
|
|
|
| 290 |
voiceSelect.appendChild(option);
|
| 291 |
});
|
| 292 |
} catch (error) {
|
|
@@ -300,13 +301,11 @@ async function handleDemoRequest(req: Request) {
|
|
| 300 |
const apiVoices = document.getElementById('apiVoices');
|
| 301 |
const currentUrl = window.location.origin;
|
| 302 |
const voices_pre = \`curl \${currentUrl}/v1/audio/models\`;
|
| 303 |
-
const examples_pre = \`
|
| 304 |
-
curl 'https://gnilets-tts.hf.space/v1/audio/speech' \\\\\\\\
|
| 305 |
-H 'content-type: application/json' \\\\\\\\
|
| 306 |
--data-raw '{"model":"brian","input":"привет! хрю-хрю!","voice":"rate:0|pitch:0"}' \\\\\\\\
|
| 307 |
-o tts_voice.mp3
|
| 308 |
\`;
|
| 309 |
-
|
| 310 |
apiVoices.textContent = voices_pre.replace(/\\\\\\\\/g, '\\\\');;
|
| 311 |
apiExamples.textContent = examples_pre.replace(/\\\\\\\\/g, '\\\\');;
|
| 312 |
|
|
|
|
| 287 |
const option = document.createElement('option');
|
| 288 |
option.value = model.model;
|
| 289 |
option.textContent = model.model;
|
| 290 |
+
if (index === 1) {option.selected = true;}
|
| 291 |
voiceSelect.appendChild(option);
|
| 292 |
});
|
| 293 |
} catch (error) {
|
|
|
|
| 301 |
const apiVoices = document.getElementById('apiVoices');
|
| 302 |
const currentUrl = window.location.origin;
|
| 303 |
const voices_pre = \`curl \${currentUrl}/v1/audio/models\`;
|
| 304 |
+
const examples_pre = \`curl 'https://gnilets-tts.hf.space/v1/audio/speech' \\\\\\\\
|
|
|
|
| 305 |
-H 'content-type: application/json' \\\\\\\\
|
| 306 |
--data-raw '{"model":"brian","input":"привет! хрю-хрю!","voice":"rate:0|pitch:0"}' \\\\\\\\
|
| 307 |
-o tts_voice.mp3
|
| 308 |
\`;
|
|
|
|
| 309 |
apiVoices.textContent = voices_pre.replace(/\\\\\\\\/g, '\\\\');;
|
| 310 |
apiExamples.textContent = examples_pre.replace(/\\\\\\\\/g, '\\\\');;
|
| 311 |
|