home · contact · privacy
Minor parsing corrections.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 26 Aug 2024 04:47:53 +0000 (06:47 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 26 Aug 2024 04:47:53 +0000 (06:47 +0200)
stable/gen_params.py

index 160735c79a1e67b2551bb19e85c0fe5436fa87d4..a1e72e86e8e2289590b994b4360a93c570aea3c3 100644 (file)
@@ -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: