From 55c4acad8f9317056cab9f0cce03394a76c535fe Mon Sep 17 00:00:00 2001 From: vfbd Date: Mon, 8 Aug 2022 18:16:08 -0400 Subject: [PATCH] Disable probability viewer and output streaming when using API --- aiserver.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aiserver.py b/aiserver.py index 884384a8..d47fa562 100644 --- a/aiserver.py +++ b/aiserver.py @@ -6952,6 +6952,10 @@ def _generate_text(body: GenerationInputSchema): vars.disable_set_aibusy = True _standalone = vars.standalone vars.standalone = True + show_probs = vars.show_probs + vars.show_probs = False + output_streaming = vars.output_streaming + vars.output_streaming = False for key, entry in mapping.items(): obj = {"vars": vars, "vars.formatoptns": vars.formatoptns}[entry[0]] if getattr(body, key, None) is not None: @@ -6983,6 +6987,8 @@ def _generate_text(body: GenerationInputSchema): setattr(obj, entry[1], saved_settings[key]) vars.disable_set_aibusy = disable_set_aibusy vars.standalone = _standalone + vars.show_probs = show_probs + vars.output_streaming = output_streaming if vars.allowsp and getattr(body, "soft_prompt", None) is not None: spRequest(old_spfilename) set_aibusy(0)