Skip to content

Commit 92cf5a0

Browse files
authored
reloading: directions for demo not found
1 parent 6261872 commit 92cf5a0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

gradio/utils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,14 @@ def prerun(self, *_args, **_kwargs):
249249

250250
def postrun(self, *_args, **_kwargs):
251251
NO_RELOAD.set(True)
252-
demo = getattr(self.watch_module, self.demo_name)
253-
if demo is not self.running_app.blocks:
254-
self.swap_blocks(demo)
255-
return True
256-
return False
252+
demo = getattr(self.watch_module, self.demo_name, None)
253+
if demo is None:
254+
print("{hint / instruction / docs link}")
255+
return False
256+
if demo is self.running_app.blocks:
257+
return False
258+
self.swap_blocks(demo)
259+
return True
257260

258261
def swap_blocks(self, demo: "Blocks"):
259262
super().swap_blocks(demo)

0 commit comments

Comments
 (0)