From 5d73d9e71ce4874bc070e790feb94bbe77b94fa7 Mon Sep 17 00:00:00 2001 From: ben_mkiv Date: Tue, 22 Aug 2023 21:49:49 +0200 Subject: [PATCH] small QoL change to the StringNone helper, to allow generated text to be "None", maybe someone wants to generate that, we never know... --- src/api/websocket_server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/websocket_server.py b/src/api/websocket_server.py index 2d77785..7695fbc 100644 --- a/src/api/websocket_server.py +++ b/src/api/websocket_server.py @@ -9,8 +9,10 @@ from utils import generate, get_autoregressive_models, get_voice_list # this is a not so nice workaround to set values to None if their string value is "None" def replaceNoneStringWithNone(message): + ignore_fields = ['text'] # list of fields which CAN have "None" as literal String value + for member in message: - if message[member] == 'None': + if message[member] == 'None' and member not in ignore_fields: message[member] = None return message