mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-06 12:30:29 +08:00
remove flask info logging
This commit is contained in:
parent
63fad8b453
commit
b069818f3f
@ -313,7 +313,6 @@ class Interface:
|
||||
is_colab = utils.colab_check()
|
||||
if is_colab:
|
||||
share = True
|
||||
print("->", share)
|
||||
if not is_colab:
|
||||
if not networking.url_ok(path_to_local_server):
|
||||
share = True
|
||||
@ -371,10 +370,8 @@ class Interface:
|
||||
if share:
|
||||
while not networking.url_ok(share_url):
|
||||
time.sleep(1)
|
||||
print("a ->")
|
||||
display(IFrame(share_url, width=1000, height=500))
|
||||
else:
|
||||
print("b ->")
|
||||
display(IFrame(path_to_local_server, width=1000, height=500))
|
||||
|
||||
r = requests.get(path_to_local_server + "enable_sharing/" + (share_url or "None"))
|
||||
|
@ -19,6 +19,7 @@ import requests
|
||||
import sys
|
||||
import csv
|
||||
import copy
|
||||
import logging
|
||||
|
||||
INITIAL_PORT_VALUE = int(os.getenv(
|
||||
'GRADIO_SERVER_PORT', "7860")) # The http server will try to open on port 7860. If not available, 7861, 7862, etc.
|
||||
@ -36,6 +37,9 @@ app = Flask(__name__,
|
||||
static_folder=STATIC_PATH_LIB)
|
||||
app.app_globals = {}
|
||||
|
||||
# Hide Flask default message
|
||||
cli = sys.modules['flask.cli']
|
||||
cli.show_server_banner = lambda *x: None
|
||||
|
||||
def set_meta_tags(title, description, thumbnail):
|
||||
app.app_globals.update({
|
||||
@ -167,6 +171,8 @@ def start_server(interface, server_port=None):
|
||||
)
|
||||
app.interface = interface
|
||||
app.cwd = os.getcwd()
|
||||
log = logging.getLogger('werkzeug')
|
||||
log.setLevel(logging.ERROR)
|
||||
process = threading.Thread(target=app.run, kwargs={"port": port})
|
||||
process.start()
|
||||
return port, app, process
|
||||
|
@ -313,7 +313,6 @@ class Interface:
|
||||
is_colab = utils.colab_check()
|
||||
if is_colab:
|
||||
share = True
|
||||
print("->", share)
|
||||
if not is_colab:
|
||||
if not networking.url_ok(path_to_local_server):
|
||||
share = True
|
||||
@ -371,10 +370,8 @@ class Interface:
|
||||
if share:
|
||||
while not networking.url_ok(share_url):
|
||||
time.sleep(1)
|
||||
print("a ->")
|
||||
display(IFrame(share_url, width=1000, height=500))
|
||||
else:
|
||||
print("b ->")
|
||||
display(IFrame(path_to_local_server, width=1000, height=500))
|
||||
|
||||
r = requests.get(path_to_local_server + "enable_sharing/" + (share_url or "None"))
|
||||
|
@ -19,6 +19,7 @@ import requests
|
||||
import sys
|
||||
import csv
|
||||
import copy
|
||||
import logging
|
||||
|
||||
INITIAL_PORT_VALUE = int(os.getenv(
|
||||
'GRADIO_SERVER_PORT', "7860")) # The http server will try to open on port 7860. If not available, 7861, 7862, etc.
|
||||
@ -36,6 +37,9 @@ app = Flask(__name__,
|
||||
static_folder=STATIC_PATH_LIB)
|
||||
app.app_globals = {}
|
||||
|
||||
# Hide Flask default message
|
||||
cli = sys.modules['flask.cli']
|
||||
cli.show_server_banner = lambda *x: None
|
||||
|
||||
def set_meta_tags(title, description, thumbnail):
|
||||
app.app_globals.update({
|
||||
@ -167,6 +171,8 @@ def start_server(interface, server_port=None):
|
||||
)
|
||||
app.interface = interface
|
||||
app.cwd = os.getcwd()
|
||||
log = logging.getLogger('werkzeug')
|
||||
log.setLevel(logging.ERROR)
|
||||
process = threading.Thread(target=app.run, kwargs={"port": port})
|
||||
process.start()
|
||||
return port, app, process
|
||||
|
Loading…
x
Reference in New Issue
Block a user