From 5080eeab08e70a4e41bb8fdb6e24b19d2b30ef71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Wed, 26 Nov 2025 23:32:36 +0100 Subject: [PATCH] Update to Gradio 6.x API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move css from gr.Blocks() to launch() - Replace show_api with footer_links parameter - Remove theme from Blocks (moved to launch in Gradio 6) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- main.py | 4 +++- src/ui/app.py | 12 +++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index f312c68..0b00bb7 100644 --- a/main.py +++ b/main.py @@ -126,11 +126,13 @@ def main(): # Launch the app logger.info("Launching application...") try: + # Gradio 6.x: show_api replaced with footer_links + footer = ["api", "gradio"] if settings.api_enabled else ["gradio"] app.launch( server_name=settings.host, server_port=settings.gradio_port, share=False, - show_api=settings.api_enabled, + footer_links=footer, ) except KeyboardInterrupt: logger.info("Shutting down...") diff --git a/src/ui/app.py b/src/ui/app.py index c4ef2eb..449ac9f 100644 --- a/src/ui/app.py +++ b/src/ui/app.py @@ -190,10 +190,9 @@ class AudioCraftApp: def build(self) -> gr.Blocks: """Build the Gradio application.""" - css = get_custom_css() - - # Create Blocks - use minimal params for compatibility - with gr.Blocks(css=css) as app: + # In Gradio 6.x, theme/css moved to launch() + # Create Blocks with no styling params + with gr.Blocks() as app: # Header with VRAM monitor with gr.Row(): with gr.Column(scale=4): @@ -307,11 +306,14 @@ class AudioCraftApp: if self.app is None: self.build() + # Gradio 6.x: theme/css go in launch() + css = get_custom_css() + self.app.launch( server_name=server_name or self.settings.host, server_port=server_port or self.settings.gradio_port, share=share, - show_error=True, + css=css, **kwargs, )