mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-17 11:29:58 +08:00
Fix reload mode warning about not being able to find the app (#6660)
* Fix warning * add changeset * Use * --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
fce80ac804
commit
523805360b
5
.changeset/deep-animals-smile.md
Normal file
5
.changeset/deep-animals-smile.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:Fix reload mode warning about not being able to find the app
|
@ -35,14 +35,14 @@ def _setup_config(
|
||||
app_text = original_path.read_text(encoding=encoding)
|
||||
|
||||
patterns = [
|
||||
f"with gr\\.Blocks\\(\\) as {demo_name}",
|
||||
f"with gr\\.Blocks\\(.*\\) as {demo_name}",
|
||||
f"{demo_name} = gr\\.Blocks",
|
||||
f"{demo_name} = gr\\.Interface",
|
||||
f"{demo_name} = gr\\.ChatInterface",
|
||||
f"{demo_name} = gr\\.TabbedInterface",
|
||||
]
|
||||
|
||||
if not any(re.search(p, app_text) for p in patterns):
|
||||
if not any(re.search(p, app_text, flags=re.DOTALL) for p in patterns):
|
||||
print(
|
||||
f"\n[bold red]Warning[/]: Cannot statically find a gradio demo called {demo_name}. "
|
||||
"Reload work may fail."
|
||||
|
Loading…
Reference in New Issue
Block a user