From b9e94381af318a4a2aedb237b566b6d8b827dace Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 13 Feb 2025 13:41:56 +0100 Subject: [PATCH] Allow Gradio share parameter passthrough (#490) Co-authored-by: Aymeric Roucher <69208727+aymeric-roucher@users.noreply.github.com> --- src/smolagents/gradio_ui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/smolagents/gradio_ui.py b/src/smolagents/gradio_ui.py index c33b60f..f744251 100644 --- a/src/smolagents/gradio_ui.py +++ b/src/smolagents/gradio_ui.py @@ -258,7 +258,7 @@ class GradioUI: "", ) - def launch(self, **kwargs): + def launch(self, share: bool = False, **kwargs): import gradio as gr with gr.Blocks(fill_height=True) as demo: @@ -290,7 +290,7 @@ class GradioUI: [stored_messages, text_input], ).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot]) - demo.launch(debug=True, share=True, **kwargs) + demo.launch(debug=True, share=share, **kwargs) __all__ = ["stream_to_gradio", "GradioUI"]