vivekchakraverty Claude Opus 4.8 commited on
Commit
066ff09
·
1 Parent(s): 91d75c7

Fix gradio 6.19 launch() compatibility

Browse files

Deployed Space installed gradio 6.19.0 (within the >=6.0,<7 range), where
show_api was fully removed from Blocks.launch() (only deprecated as of
the 6.13.0 I tested locally) -- caused a hard startup TypeError. Also
proactively move theme from the Blocks constructor to launch(), since
it hit the same deprecation-then-removal pattern.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -167,7 +167,7 @@ def make_analyze_handler(slot_index: int):
167
 
168
 
169
  def build_ui() -> gr.Blocks:
170
- with gr.Blocks(title="GuestPostSuggester", theme=gr.themes.Soft()) as demo:
171
  gr.Markdown(INTRO)
172
  with gr.Row():
173
  topic_box = gr.Textbox(label="Topic", placeholder="e.g. sustainable travel", scale=4)
@@ -224,4 +224,8 @@ def build_ui() -> gr.Blocks:
224
 
225
 
226
  if __name__ == "__main__":
227
- build_ui().queue().launch(server_name="0.0.0.0", server_port=7860, show_api=False)
 
 
 
 
 
167
 
168
 
169
  def build_ui() -> gr.Blocks:
170
+ with gr.Blocks(title="GuestPostSuggester") as demo:
171
  gr.Markdown(INTRO)
172
  with gr.Row():
173
  topic_box = gr.Textbox(label="Topic", placeholder="e.g. sustainable travel", scale=4)
 
224
 
225
 
226
  if __name__ == "__main__":
227
+ # show_api was deprecated in gradio 6.13 and removed entirely by 6.19 don't pass it.
228
+ # theme moved from the Blocks constructor to launch() as of gradio 6.0.
229
+ build_ui().queue().launch(
230
+ server_name="0.0.0.0", server_port=7860, theme=gr.themes.Soft(),
231
+ )