Skip to content

Commit 94a20d1

Browse files
committed
Fix GradioUI system prompt
On the GradioUI the system prompt displayed is *always* using the default system prompt, which is problematic when running the service with a custom system prompt (`system_prompt_path`) and allowing overriding it (`enable_system_prompt_override: true`). With this simple patch we default to the configured system prompt on the GradioUI and only use the default system prompt if we don't have it configured.
1 parent fa812b7 commit 94a20d1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ols/src/ui/gradio_ui.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ def __init__(
3434
additional_inputs = [use_history, provider, model]
3535
if config.dev_config.enable_system_prompt_override:
3636
system_prompt = gr.TextArea(
37-
value=prompts.QUERY_SYSTEM_INSTRUCTION, label="System prompt"
37+
value=config.ols_config.system_prompt
38+
or prompts.QUERY_SYSTEM_INSTRUCTION,
39+
label="System prompt",
3840
)
3941
additional_inputs.append(system_prompt)
4042
self.ui = gr.ChatInterface(self.chat_ui, additional_inputs=additional_inputs)

0 commit comments

Comments
 (0)