Fork 0

small QoL change to the StringNone helper, to allow generated text to be "None", maybe someone wants to generate that, we never know...

ben_mkiv 2023-08-22 21:49:49 +07:00
parent 9abcb0f193
commit 5d73d9e71c
1 changed files with 3 additions and 1 deletions

@ -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