From 2e0860e4530b158f41257ff6591810ab3b2936e3 Mon Sep 17 00:00:00 2001 From: Christian Heller <c.heller@plomlompom.de> Date: Mon, 26 Aug 2024 06:47:53 +0200 Subject: [PATCH] Minor parsing corrections. --- stable/gen_params.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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: -- 2.30.2