Skip to content

Commit

Permalink
enable share kaggle
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyaboulton committed Jan 31, 2023
1 parent 5264b4c commit 7bd425a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gradio/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,7 @@ def reverse(text):
self.server = server
self.is_running = True
self.is_colab = utils.colab_check()
self.is_kaggle = utils.kaggle_check()
self.protocol = (
"https"
if self.local_url.startswith("https") or self.is_colab
Expand All @@ -1405,7 +1406,7 @@ def reverse(text):
share
if share is not None
else True
if self.is_colab and self.enable_queue
if (self.is_colab and self.enable_queue) or self.is_kaggle
else False
)

Expand Down
4 changes: 4 additions & 0 deletions gradio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ def colab_check() -> bool:
return is_colab


def kaggle_check() -> bool:
return bool(os.environ.get('KAGGLE_KERNEL_RUN_TYPE') or os.environ.get('GFOOTBALL_DATA_DIR'))


def ipython_check() -> bool:
"""
Check if interface is launching from iPython (not colab)
Expand Down

0 comments on commit 7bd425a

Please sign in to comment.