gnilets commited on
Commit
b6e2655
·
verified ·
1 Parent(s): 25fe839

Update main.ts

Browse files
Files changed (1) hide show
  1. main.ts +23 -24
main.ts CHANGED
@@ -273,7 +273,7 @@ async function handleDemoRequest(req: Request) {
273
  });
274
 
275
  });
276
-
277
  async function fetchModels() {
278
  try {
279
  const response = await fetch('/v1/audio/models');
@@ -291,29 +291,29 @@ async function handleDemoRequest(req: Request) {
291
  }
292
  }
293
  fetchModels();
 
294
  function createApiExamples() {
295
- const apiExamples = document.getElementById('apiExamples');
296
- const currentUrl = window.location.origin;
297
-
298
- const examples = \`
299
- GET ${currentUrl}/v1/audio/models
300
- Returns a list of available models.
301
-
302
- POST ${currentUrl}/v1/audio/speech
303
- Request body example:
304
- {
305
- "model": "remy",
306
- "input": "привет",
307
- "voice": "rate:0|pitch:0"
308
- }
309
-
310
- Example curl request:
311
- curl '${currentUrl}/v1/audio/speech' -H 'content-type: application/json' --data-raw '{"model":"remy","input":"привет","voice":"rate:0|pitch:0"}' -o voice.mp3
312
- \`;
313
 
314
- apiExamples.textContent = examples;
315
- }
316
- createApiExamples();
 
 
 
317
  </script>
318
  </body></html>`;
319
 
@@ -324,8 +324,7 @@ async function handleDemoRequest(req: Request) {
324
 
325
  async function handleVoiceList() {
326
  let voices = [{model: 'ava', gender: 'female'}, {model: 'andrew', gender: 'male'}, {model: 'emma', gender: 'female'}, {model: 'brian', gender: 'male'}, {model: 'vivienne', gender: 'female'}, {model: 'remy', gender: 'male'}, {
327
- model: 'seraphina',
328
- gender: 'female'
329
  }, {model: 'florian', gender: 'male'}, {model: 'dmitry', gender: 'male'}, {model: 'svetlana', gender: 'female'}];
330
 
331
  const sortedVoiceList = voices.sort((a, b) => {
 
273
  });
274
 
275
  });
276
+
277
  async function fetchModels() {
278
  try {
279
  const response = await fetch('/v1/audio/models');
 
291
  }
292
  }
293
  fetchModels();
294
+
295
  function createApiExamples() {
296
+ const apiExamples = document.getElementById('apiExamples');
297
+ const currentUrl = window.location.origin;
298
+
299
+ const examples = \`
300
+ GET \${currentUrl}/v1/audio/models
301
+ Returns a list of available models.
302
+
303
+ POST \${currentUrl}/v1/audio/speech
304
+ Request body example:
305
+ {
306
+ "model": "remy",
307
+ "input": "привет",
308
+ "voice": "rate:0|pitch:0"
309
+ }
 
 
 
 
310
 
311
+ Example curl request:
312
+ curl '\${currentUrl}/v1/audio/speech' -H 'content-type: application/json' --data-raw '{"model":"remy","input":"привет","voice":"rate:0|pitch:0"}' -o voice.mp3
313
+ \`;
314
+
315
+ apiExamples.textContent = examples;
316
+ }
317
  </script>
318
  </body></html>`;
319
 
 
324
 
325
  async function handleVoiceList() {
326
  let voices = [{model: 'ava', gender: 'female'}, {model: 'andrew', gender: 'male'}, {model: 'emma', gender: 'female'}, {model: 'brian', gender: 'male'}, {model: 'vivienne', gender: 'female'}, {model: 'remy', gender: 'male'}, {
327
+ model: 'seraphina', gender: 'female'
 
328
  }, {model: 'florian', gender: 'male'}, {model: 'dmitry', gender: 'male'}, {model: 'svetlana', gender: 'female'}];
329
 
330
  const sortedVoiceList = voices.sort((a, b) => {