mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
colab check fix
This commit is contained in:
parent
24d84ba612
commit
2bf81d0988
@ -403,10 +403,11 @@ class Interface:
|
|||||||
is_colab = utils.colab_check()
|
is_colab = utils.colab_check()
|
||||||
if is_colab or not(networking.url_ok(path_to_local_server)):
|
if is_colab or not(networking.url_ok(path_to_local_server)):
|
||||||
share = True
|
share = True
|
||||||
if debug:
|
if is_colab:
|
||||||
print(strings.en["COLAB_DEBUG_TRUE"])
|
if debug:
|
||||||
else:
|
print(strings.en["COLAB_DEBUG_TRUE"])
|
||||||
print(strings.en["COLAB_DEBUG_FALSE"])
|
else:
|
||||||
|
print(strings.en["COLAB_DEBUG_FALSE"])
|
||||||
else:
|
else:
|
||||||
print(strings.en["RUNNING_LOCALLY"].format(path_to_local_server))
|
print(strings.en["RUNNING_LOCALLY"].format(path_to_local_server))
|
||||||
|
|
||||||
|
@ -310,6 +310,6 @@ def setup_tunnel(local_server_port):
|
|||||||
def url_ok(url):
|
def url_ok(url):
|
||||||
try:
|
try:
|
||||||
r = requests.head(url)
|
r = requests.head(url)
|
||||||
return r.status_code == 200 or r.status_code == 401
|
return r.status_code == 200
|
||||||
except (ConnectionError, requests.exceptions.ConnectionError):
|
except (ConnectionError, requests.exceptions.ConnectionError):
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user