Skip to content

Commit

Permalink
Fixed warning about not being able to find the app for some pattern (#…
Browse files Browse the repository at this point in the history
…10290)

* updated pattern to support both gr.Blocks and Blocks usage

* add changeset

* add changeset

* Code

---------

Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: freddyaboulton <[email protected]>
  • Loading branch information
3 people authored Jan 6, 2025
1 parent 2c099f8 commit 99123e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/early-wombats-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": patch
---

fix:Fixed warning about not being able to find the app for some pattern
2 changes: 1 addition & 1 deletion gradio/cli/commands/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _setup_config(
app_text = original_path.read_text(encoding=encoding)

patterns = [
f"with gr\\.Blocks\\(.*\\) as {demo_name}",
rf"with (?:gr\.)?Blocks\(.*\) as {demo_name}",
f"{demo_name} = gr\\.Blocks",
f"{demo_name} = gr\\.Interface",
f"{demo_name} = gr\\.ChatInterface",
Expand Down

0 comments on commit 99123e7

Please sign in to comment.