From 8bc42319f6bc430448867e8b88b7f8891b50bf49 Mon Sep 17 00:00:00 2001 From: aliabd Date: Mon, 2 Nov 2020 16:51:50 +0400 Subject: [PATCH] fix launch port issue --- build/lib/gradio/interface.py | 4 ++-- gradio/interface.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/lib/gradio/interface.py b/build/lib/gradio/interface.py index 87082a8ae8..d7e47329af 100644 --- a/build/lib/gradio/interface.py +++ b/build/lib/gradio/interface.py @@ -119,7 +119,6 @@ class Interface: self.flagging_dir = flagging_dir Interface.instances.add(self) self.analytics_enabled=analytics_enabled - self.launch_port = None self.save_to = None self.share = None @@ -341,6 +340,7 @@ class Interface: server_port, app, thread = networking.start_server( self, self.server_name, self.server_port) path_to_local_server = "http://{}:{}/".format(self.server_name, server_port) + self.server_port = server_port self.status = "RUNNING" self.server = app @@ -365,7 +365,7 @@ class Interface: print("This share link will expire in 6 hours. If you need a " "permanent link, email support@gradio.app") try: - share_url = networking.setup_tunnel(self.launch_port) + share_url = networking.setup_tunnel(server_port) print("Running on External URL:", share_url) except RuntimeError: data = {'error': 'RuntimeError in launch method'} diff --git a/gradio/interface.py b/gradio/interface.py index 87082a8ae8..d7e47329af 100644 --- a/gradio/interface.py +++ b/gradio/interface.py @@ -119,7 +119,6 @@ class Interface: self.flagging_dir = flagging_dir Interface.instances.add(self) self.analytics_enabled=analytics_enabled - self.launch_port = None self.save_to = None self.share = None @@ -341,6 +340,7 @@ class Interface: server_port, app, thread = networking.start_server( self, self.server_name, self.server_port) path_to_local_server = "http://{}:{}/".format(self.server_name, server_port) + self.server_port = server_port self.status = "RUNNING" self.server = app @@ -365,7 +365,7 @@ class Interface: print("This share link will expire in 6 hours. If you need a " "permanent link, email support@gradio.app") try: - share_url = networking.setup_tunnel(self.launch_port) + share_url = networking.setup_tunnel(server_port) print("Running on External URL:", share_url) except RuntimeError: data = {'error': 'RuntimeError in launch method'}