Skip to content

Commit 90f0efa

Browse files
committed
Fix gr.Interface() not to override the default title value
1 parent 84644fd commit 90f0efa

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

gradio/interface.py

-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ def __init__(
337337
self.fn_durations = [0, 0]
338338
self.__name__ = getattr(fn, "__name__", "fn")
339339
self.live = live
340-
self.title = title
341340

342341
self.simple_description = utils.remove_html_tags(description)
343342
self.description = description

gradio/routes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ def manifest_json():
14451445
return ORJSONResponse(
14461446
content={
14471447
# NOTE: Required members: https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable#required_manifest_members
1448-
"name": app.get_blocks().title or "Gradio",
1448+
"name": app.get_blocks().title,
14491449
"icons": [
14501450
{
14511451
"src": "static/img/logo192.svg",

test/test_interfaces.py

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ def captured_output():
2828

2929

3030
class TestInterface:
31+
def test_default_title(self):
32+
io = Interface(lambda x: x, "textbox", "label")
33+
assert io.title == "Gradio"
34+
3135
def test_close(self):
3236
io = Interface(lambda input: None, "textbox", "label")
3337
_, local_url, _ = io.launch(prevent_thread_lock=True)

0 commit comments

Comments
 (0)