Skip to content

fix: support Gradio 6 styling kwargs without breaking Gradio 5#295

Open
voidborne-d wants to merge 1 commit intonari-labs:mainfrom
voidborne-d:fix/issue-286
Open

fix: support Gradio 6 styling kwargs without breaking Gradio 5#295
voidborne-d wants to merge 1 commit intonari-labs:mainfrom
voidborne-d:fix/issue-286

Conversation

@voidborne-d
Copy link
Copy Markdown

Summary

Make the Gradio demo work across both Gradio 5 and 6 without pinning the dependency.

Changes

  • add a small compatibility helper that routes css and theme to gr.Blocks(...) when the installed Gradio version still supports them
  • pass those styling kwargs to demo.launch(...) when running on Gradio 6, where they were moved
  • add a lightweight regression test covering both API shapes

Testing

  • python3 -m unittest tests.test_gradio_compat -v

Fixes #286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gradio 6.x breaks dia - TypeError: BlockContext.__init__() got an unexpected keyword argument 'css'

2 participants