From 2239be2351586a18194fcbd49b072aa3cf3f56c7 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 28 Jan 2023 23:08:28 -0300 Subject: [PATCH] Support for number/bool extension parameters --- server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 056e5f90..67fb2ff8 100644 --- a/server.py +++ b/server.py @@ -613,8 +613,12 @@ if args.chat or args.cai_chat: if extension_state[ext][0] == True: params = eval(f"extensions.{ext}.script.params") for param in params: - if type(params[param] == str): + if type(params[param]) == str: extensions_ui_elements.append(gr.Textbox(value=params[param], label=param)) + elif type(params[param]) in [int, float]: + extensions_ui_elements.append(gr.Number(value=params[param], label=param)) + elif type(params[param]) == bool: + extensions_ui_elements.append(gr.Checkbox(value=params[param], label=param)) def update_extensions_parameters(*kwargs): i = 0