Spaces:
Sleeping
Sleeping
AndrewRqy commited on
Commit ·
c38b046
1
Parent(s): 9233b44
Address Gradio 6 deprecation: set theme+css as Blocks attrs, not constructor args
Browse files4407 unmodified lines44084409441044114412441344144415441644174418441944204421421 unmodified lines4843484448454846484748484407 unmodified linesinput_background_fill="#251d2e",)# Gradio 6 prefers theme + css on launch(), but HF Space's launcher# imports the module and runs its own launch() with defaults — anything# we set on our own launch() call is bypassed there. So we pass these# to gr.Blocks() despite the deprecation warning; that's the only path# Gradio actually reads on HF Space.with gr.Blocks(theme=_apprentice_theme,css=composed_css,title="The Apprentice",analytics_enabled=False,) as demo:421 unmodified linesshow_progress="hidden",)return demo4407 unmodified lines44084409441044114412441344144415441644174418421 unmodified lines4840484148424843484448454846484748484849485048514407 unmodified linesinput_background_fill="#251d2e",)# Gradio 6 moved theme + css from Blocks() to launch(). They're set as# attributes on the Blocks instance after construction so HF Space's# own launcher (which calls .launch() with defaults, ignoring any args# we pass to our own launch()) still picks them up.with gr.Blocks(title="The Apprentice",analytics_enabled=False,) as demo:421 unmodified linesshow_progress="hidden",)# Gradio 6: theme + css are launch() params, not Blocks() params. But# HF Space's launcher calls .launch() itself with defaults — so we# attach them as attributes on the Blocks instance. Gradio reads# demo.theme and demo.css at launch time regardless of who calls launch.demo.theme = _apprentice_themedemo.css = composed_cssreturn demo
app.py+10-7