From 574e1cb7b4c63556b68e85ab8604365084215e58 Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Sat, 18 Jul 2020 13:08:53 -0500 Subject: [PATCH] added env port --- gradio/networking.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gradio/networking.py b/gradio/networking.py index b940cd6a27..c4a39bef46 100644 --- a/gradio/networking.py +++ b/gradio/networking.py @@ -18,13 +18,12 @@ import sys import analytics -INITIAL_PORT_VALUE = ( - 7860 -) # The http server will try to open on port 7860. If not available, 7861, 7862, etc. -TRY_NUM_PORTS = ( - 100 -) # Number of ports to try before giving up and throwing an exception. -LOCALHOST_NAME = os.getenv('GRADIO_SERVER_NAME', "127.0.0.1") +INITIAL_PORT_VALUE = os.getenv( + 'GRADIO_SERVER_PORT', "7860") # The http server will try to open on port 7860. If not available, 7861, 7862, etc. +TRY_NUM_PORTS = os.getenv( + 'GRADIO_NUM_PORTS', "100") # Number of ports to try before giving up and throwing an exception. +LOCALHOST_NAME = os.getenv( + 'GRADIO_SERVER_NAME', "127.0.0.1") GRADIO_API_SERVER = "https://api.gradio.app/v1/tunnel-request" STATIC_TEMPLATE_LIB = pkg_resources.resource_filename("gradio", "templates/")