From: Christian Heller Date: Mon, 26 Aug 2024 04:47:53 +0000 (+0200) Subject: Minor parsing corrections. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/todo?a=commitdiff_plain;h=2e0860e4530b158f41257ff6591810ab3b2936e3;p=stable_plom Minor parsing corrections. --- diff --git a/stable/gen_params.py b/stable/gen_params.py index 160735c..a1e72e8 100644 --- a/stable/gen_params.py +++ b/stable/gen_params.py @@ -27,10 +27,13 @@ class GenParams: d = {} first_split = string.split('; PROMPT: ', maxsplit=1) if 2 == len(first_split): - d['prompt'] = first_split[1] + d['prompt'] = first_split[1].strip() + if not d['prompt']: + d['prompt'] = ' ' for section in first_split[0].split('; '): key, val = section.split(': ', maxsplit=1) - key = key.lower() + key = key.lower().strip() + val = val.strip() if key.upper() in GEN_PARAMS_INT: val = int(val) elif key.upper() in GEN_PARAMS_FLOAT: