Websocket server, override args parameters for model settings (squashed)
favor existing arguments from parameters (kwargs) over global (args) added parameter to specify the autoregressive_model (tho it still loads the default model first, and then loads the target model, which seems to be because TTS loading just loads whatever is set in the settings first) removed load_tts() call, the cli tool now relys on generate() to load the tts system, which is less fail prone imho Revert "added parameter to specify the autoregressive_model (tho it still loads the default model first, and then loads the target model, which seems to be because TTS loading just loads whatever is set in the settings first)" This reverts commitd1dbe3e464
. Revert "added parameter to specify the autoregressive_model (tho it still loads the default model first, and then loads the target model, which seems to be because TTS loading just loads whatever is set in the settings first)" This reverts commitd1dbe3e464
. Revert "favor existing arguments from parameters (kwargs) over global (args)" This reverts commit89102347a9
. args are now updated in the websocket server remove unused import
This commit is contained in:
parent
5d73d9e71c
commit
d16ba3a06d
|
@ -4,7 +4,7 @@ from threading import Thread
|
||||||
|
|
||||||
from websockets.server import serve
|
from websockets.server import serve
|
||||||
|
|
||||||
from utils import generate, get_autoregressive_models, get_voice_list
|
from utils import generate, get_autoregressive_models, get_voice_list, args
|
||||||
|
|
||||||
|
|
||||||
# this is a not so nice workaround to set values to None if their string value is "None"
|
# this is a not so nice workaround to set values to None if their string value is "None"
|
||||||
|
@ -19,6 +19,21 @@ def replaceNoneStringWithNone(message):
|
||||||
|
|
||||||
|
|
||||||
async def _handle_generate(websocket, message):
|
async def _handle_generate(websocket, message):
|
||||||
|
global args
|
||||||
|
|
||||||
|
# update args parameters which control the model settings
|
||||||
|
if message.get('autoregressive_model'):
|
||||||
|
args.autoregressive_model = message['autoregressive_model']
|
||||||
|
|
||||||
|
if message.get('diffusion_model'):
|
||||||
|
args.diffusion_model = message['diffusion_model']
|
||||||
|
|
||||||
|
if message.get('tokenizer_json'):
|
||||||
|
args.tokenizer_json = message['tokenizer_json']
|
||||||
|
|
||||||
|
if message.get('sample_batch_size'):
|
||||||
|
args.sample_batch_size = message['sample_batch_size']
|
||||||
|
|
||||||
message['result'] = generate(**message)
|
message['result'] = generate(**message)
|
||||||
await websocket.send(json.dumps(replaceNoneStringWithNone(message)))
|
await websocket.send(json.dumps(replaceNoneStringWithNone(message)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user