added simple websocket server which allows to start tts generation tasks, retrieving autoregressive models and voices list #328

Merged
mrq merged 1 commits from :master into master 2023-08-16 14:01:46 +00:00
Contributor

this is really simple but works for me,

by default the server only listens on localhost, if you want to access it from the whole network you got to change the listen_address from 127.0.0.1 to something else, personally i wouldn't advice to start the server on a public network address, as there's no security checks at all, so only recommended for local usage!

the requests are performed in json, e.g.:

{
    "action": "generate",
    "text": "hello world",
    "delimiter": "\n",
    "emotion": "None",
    "prompt": "",
    "voice": "angie",
    "mic_audio": "None",
    "voice_latents_chunks": "None",
    "candidates": 1,
    "seed": -1,
    "num_autoregressive_samples": 16,
    "diffusion_iterations": 30,
    "temperature": 0.8,
    "diffusion_sampler": "DDIM",
    "breathing_room": 8,
    "cvvp_weight": 0.0,
    "top_p": 0.8,
    "diffusion_temperature": 1.0,
    "length_penalty": 1.0,
    "repetition_penalty": 2.0,
    "cond_free_k": 2.0,
    "experimentals": "None"
}
{
    "action": "get_voices"
}
{
    "action": "get_autoregressive_models"
}
this is really simple but works for me, by default the server only listens on localhost, if you want to access it from the whole network you got to change the listen_address from 127.0.0.1 to something else, personally i wouldn't advice to start the server on a public network address, as there's no security checks at all, so only recommended for local usage! the requests are performed in json, e.g.: ``` { "action": "generate", "text": "hello world", "delimiter": "\n", "emotion": "None", "prompt": "", "voice": "angie", "mic_audio": "None", "voice_latents_chunks": "None", "candidates": 1, "seed": -1, "num_autoregressive_samples": 16, "diffusion_iterations": 30, "temperature": 0.8, "diffusion_sampler": "DDIM", "breathing_room": 8, "cvvp_weight": 0.0, "top_p": 0.8, "diffusion_temperature": 1.0, "length_penalty": 1.0, "repetition_penalty": 2.0, "cond_free_k": 2.0, "experimentals": "None" } ``` ``` { "action": "get_voices" } ``` ``` { "action": "get_autoregressive_models" } ```
ben_mkiv added 1 commit 2023-08-16 10:57:48 +00:00
Author
Contributor

important note, it might be necessary to add the websockets package to the requirements, not sure about that, i barely know what i do in python...

important note, it might be necessary to add the websockets package to the requirements, not sure about that, i barely know what i do in python...
Owner

Nice nice.

by default the server only listens on localhost, if you want to access it from the whole network you got to change the listen_address from 127.0.0.1 to something else, personally i wouldn't advice to start the server on a public network address, as there's no security checks at all, so only recommended for local usage!

When I get a moment I can have it leverage the listen argument as that handles what IP to listen on and the port.

important note, it might be necessary to add the websockets package to the requirements, not sure about that, i barely know what i do in python...

Just add the PIP-named package in the requirements.txt. I can do that too when I get a moment.

Nice nice. > by default the server only listens on localhost, if you want to access it from the whole network you got to change the listen_address from 127.0.0.1 to something else, personally i wouldn't advice to start the server on a public network address, as there's no security checks at all, so only recommended for local usage! When I get a moment I can have it leverage the listen argument as that handles what IP to listen on and the port. > important note, it might be necessary to add the websockets package to the requirements, not sure about that, i barely know what i do in python... Just add the PIP-named package in the `requirements.txt`. I can do that too when I get a moment.
mrq merged commit 91a0c495ff into master 2023-08-16 14:01:46 +00:00
Sign in to join this conversation.
No description provided.