Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/open-sides-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:reloading: directions for demo not found
13 changes: 8 additions & 5 deletions gradio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,14 @@ def prerun(self, *_args, **_kwargs):

def postrun(self, *_args, **_kwargs):
NO_RELOAD.set(True)
demo = getattr(self.watch_module, self.demo_name)
if demo is not self.running_app.blocks:
self.swap_blocks(demo)
return True
return False
demo = getattr(self.watch_module, self.demo_name, None)
if demo is None:
print("{hint / instruction / docs link}")
return False
if demo is self.running_app.blocks:
return False
self.swap_blocks(demo)
return True

def swap_blocks(self, demo: "Blocks"):
super().swap_blocks(demo)
Expand Down
Loading