From fd743a02074d58d2515116d558b4800da15bb9ee Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 17 May 2023 02:34:29 -0300 Subject: [PATCH] Small change --- server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index b2cee779..43cd0624 100644 --- a/server.py +++ b/server.py @@ -132,9 +132,11 @@ def save_prompt(text, fname): with open(Path(f'prompts/{fname}.txt'), 'w', encoding='utf-8') as f: f.write(text) - return f"Saved to prompts/{fname}.txt", gr.update(visible=False), gr.update(visible=True), gr.update(visible=False) + message = f"Saved to prompts/{fname}.txt" else: - return "Error: No prompt name given.", gr.update(visible=True), gr.update(visible=False), gr.update(visible=True) + message = "Error: No prompt name given." + + return message, gr.update(visible=False), gr.update(visible=True), gr.update(visible=False) def load_prompt(fname):